Java desde Cero 2024 | 5.2 - Clases y Objetos (Parte 2)
Leonardo Parra@leonardoparra
Buen Dia, profe queria preguntarte por que a mi me genera un error al hacer el codigo como lo muestras en el video, pero me imprimio lo mismo, cuando le pase directamente los valores de los argumentos en el orden correcto asi:
1 2public class Main { 3 4 public static void main(String... args) { 5 6 //Book bookOne = new Book(title: "Java", author: "John Doe", year: 2022); 7 //Book bookTwo = new Book(title: "Python", author: "Jane Smith", year: 2021); 8 Book bookOne = new Book("Java", "John Doe", 2022); 9 Book bookTwo = new Book("Python", "Jane Smith", 2021); 10 11 System.out.println(bookOne); 12 System.out.println(bookTwo); 13 } 14}
Escribe una respuesta