...
The Book
class should have appropriate constructors, getters, and setters. The BookShelf
class should have methods to add a book, remove a book, get a book based on index, and return an iterator for its books. (Hint: you might want to use a List in your Bookshelf - private List<Book> books;
)
Test Your Implementation
Create a Main
class that will create a BookShelf
, add some Book
instances to it, and then use a BookIterator
to iterate through the books and print out their details.
...