publicstaticvoidmain(String[] args){ //BookShelf bookShelf = new BookShelf(4); BookShelf bookShelf = new BookShelf(); bookShelf.appendBook(new Book("Around the World in 80 Days")); bookShelf.appendBook(new Book("Bible")); bookShelf.appendBook(new Book("Cinderella")); bookShelf.appendBook(new Book("Dady-Long-Legs")); bookShelf.appendBook(new Book("Gone with the wind!")); Iterator it = bookShelf.iterator(); while(it.hasNext()){ Book book = (Book) it.next(); System.out.println(book.getName()); } }
近期评论