public class Library { Book[] books = new Book[3]; public Library(Book b1, Book b2, Book b3) { books[0]=b1; books[1]=b2; books[2]=b3; } public Book search(String title, String author, int year, Size sz) { Book book = new Book(title, author, year, sz); for (int i=0;i<3;i++) { if (book.equals(books[i])) { return books[i]; } } return null; } public static void main(String[] args) { Size sz = new Size(); //default constructor height=11, width=8.5 Book tb1 = new Book("T1", "A1", 1991, sz); Book tb2 = new Book("T2", "A1", 1991, sz); Book tb3 = new Book("T3", "A1", 1991, sz); Library library = new Library(tb1, tb2, tb3); Book result = library.search("T2", "A1", 1991, sz); System.out.println("Found " + result.getTitle()); if (result.getAvailable()) { System.out.println("Hey great, it's available!!!!"); } result.checkOut(); if (result.getAvailable()) { System.out.println("One more copy is available!"); } else { System.out.println("OK -- the last copy is checked out."); } } }