I created a book class with various methods. On top of that I created another class called Library. Library class constructor is supposed to have a field saying how many books are in the "library". You enter a number, and it should generate an array with the specified number of slots (that will contain books). Those slots should be filled with books objects that are called Book 1 Book 2... Book n.
I managed to create this Array but I can't create a method that adds the books (and calls them Book 1, 2, 3 and so on).
How should I go about doing this?
public class Library
private TextBook bookShelf;
public int nextBook;
private int borrowers;
public Library(int max)
bookShelf = new TextBook[max];
nextBook = 0;
is what i got so far.
help me and u shall be rewarded
Duplicate post of http://forum.java.sun.com/thread.jspa?threadID=5231963
I'll not reporting abuse because I assume it was accidental due to the quick succession of posting. Please be careful in the future not to double post.