Hi,
I'm having problems with week 6 exercise 101.2 on course OOP part 1.
When I iterate over the array items (created in the Library class, holding all the Book objects) I get an empty output. I thought that by calling the toString() method, implemented in the Book class, I would easily get to print all the info of all the books stored in the array.
If I instead use "sout" I get the expected output.
What am I missing?
public void printBooks(){
for (Book obj : this.items){
obj.toString(); //this works instead: System.out.println(obj);
}
}
Best regards,
Alberto