Originally posted by James .D.Johnstone:
The array that i am creating must be of book1 type.I want to create the objects in the book class.each object must have a title assigned to it ,then it has to be printed to screen.I am unsure how to get the book1 objects in the array to hold the title of the books that I will eventually pass to them.
It took a while, but it finally clicked...
Anyway, change the title variable in your book class to String, as you are storing a string. When you populate the array, do *not* call the getTitle() method. Simply store the object that you create into the array.
Later, when you need to print to the screen, call the getTitle() method to get the title then.
Is that what you are looking for?
Henry