I have two class: Library and Book.
I want to construct a Book class by calling its class constructor from the Library class. How can i do this? My code doesn't work (Error: Cannot find symbol - Constructor Book() )Here is the book constructor:Code:public void createBook() { Book newBook; newBook = new Book(); //Error line }Code:public Book(String BookAuthor, String BookTitle, String BookCost, String NumberOfPages, String BookGenre, int bookEnjoyability) { //Initialise variables this.BookAuthor = BookAuthor; this.BookTitle = BookTitle; this.BookCost = BookCost; this.NumberOfPages = NumberOfPages; this.BookGenre = BookGenre; this.bookEnjoyability = bookEnjoyability; }




Reply With Quote