Before creating an instance of a Book object, the code needs to read in all the data from the user that is needed to create the Book object. When all the data is available, call the Book class's...
Type: Posts; User: Norm
Before creating an instance of a Book object, the code needs to read in all the data from the user that is needed to create the Book object. When all the data is available, call the Book class's...
Where is the Book class?
The action listener classes have the wrong names. The names look like the names for a button, not a listener.
Also posted at...
The Book class could have a method that would do the comparing needed to find matches with the String the user input. The method could return true if there was a match and false otherwise.
You...
That is correct.
Can you explain the purpose of the comparison you want to make?
What does the String contain?
There are several ways You can use a String to find or select a Book.
What is the purpose of comparing it to a String? What data does the String contain?
Do you know how to define an array? Here's a sample:
TheType[] varName = new TheType[<nbr of elements>];
What data do you want to compare?
The Book class could have a method that returns a String
or it could have a method that tested its data against a given argument.
It the array to be update is in the Library class, should the addBook() method be in the Library class?
arrays do not have constructors. Use the new statement to define an array. See:
Arrays...
There are a lot of things to think about before trying to write the method:
What class will the add() method be in?
Where will the array be that it stores the data in?
Will all the data be put...
Your description of what the add() method should do does not make sense,
A method can not be displayed. It can display data that is in the program.
That description sounds more like what a Book...
Can you describe what the add book method should do? What data will it take as its arguments and what will it do with that data?