|2eM!x
Apr 4th, 2007, 03:51 PM
Okay for a project at school I'm writing a Library class and a book class. So in the library class I search for a book at a certain time, when its found I want to return just that book and access some methods from it.
book myBook = bookSearcher.searchForTitle("The Lorax"); // searches for a title and returns an object of book class
System.out.println(myBook.getAuthor());
The getAuthor code never gets called, neither does searchForTitle. I don't understand what is going on. How can I set myBook to a returned book variable?
book myBook = bookSearcher.searchForTitle("The Lorax"); // searches for a title and returns an object of book class
System.out.println(myBook.getAuthor());
The getAuthor code never gets called, neither does searchForTitle. I don't understand what is going on. How can I set myBook to a returned book variable?