Question: public class Book { private String title; private String author; private String publisher; private String publicationDate; public Book() { } public Book(String title, String author,
public class Book { private String title; private String author; private String publisher; private String publicationDate; public Book() { } public Book(String title, String author, String publisher, String publicationDate) { this.title = title; this.author = author; this.publisher = publisher; this.publicationDate = publicationDate; } public void setTitle(String userTitle) { title = userTitle; } public String getTitle() { return title; } public void setAuthor(String userAuthor) { author = userAuthor; } public String getAuthor(){ return author; } public void setPublisher(String userPublisher) { publisher = userPublisher; } public String getPublisher() { return publisher; } public void setPublicationDate(String userPublicationDate) { publicationDate = userPublicationDate; } public String getPublicationDate() { return publicationDate; } public void printInfo() { System.out.println("Book Information: "); System.out.println(" Book Title: " + title); System.out.println(" Author: " + author); System.out.println(" Publisher: " + publisher); System.out.println(" Publication Date: " + publicationDate); } }
// TODO: Create class named Encyclopedia that is derived from Book // TODO: Declare private fields: edition, numVolumes //TODO: Create a Default Constructor. IMPORTANT: Without a default constructor, the autograder will not work. //TODO: Create Parameterized Constructor. // TODO: Define mutator methods - // setEdition(), setNumVolumes() // TODO: Define accessor methods - // getEdition(), getNumVolumes() // TODO: Define a printInfo() method that overrides (make sure you include @Override in the appropriate location // the printInfo in Book class
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
