Looking for answers? Westonci.ca is your go-to Q&A platform, offering quick, trustworthy responses from a community of experts. Ask your questions and receive precise answers from experienced professionals across different disciplines. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.
Sagot :
Answer:
Explanation:
The Book class and BookInformation class was not provided but was found online. After analyzing both of these classes I have created the following code that grabs and overrides the printInfo() method in order to add and print the edition and number of volumes as well
public class Encyclopedia extends Book {
String edition;
int numVolumes;
public String getEdition() {
return edition;
}
public void setEdition(String edition) {
this.edition = edition;
}
public int getNumVolumes() {
return numVolumes;
}
public void setNumVolumes(int numVolumes) {
this.numVolumes = numVolumes;
}
public void printInfo() {
System.out.println("Book Information: ");
System.out.println(" Book Title: " + super.title);
System.out.println(" Author: " + author);
System.out.println(" Publisher: " + publisher);
System.out.println(" Publication Date: " + publicationDate);
System.out.println(" Edition: " + getEdition());
System.out.println(" Number of Volumes: " + getNumVolumes());
}
}
Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.