Question: Assignment: Imagine you're developing a digital library system, which includes a base class Book with properties title ( String ) and pages ( int )
Assignment: Imagine you're developing a digital library system, which includes a base class Book with properties title String and pages int along with their respective public getters getTitle and getPages You are tasked with creating a subclass named Ebook that extends Book. This subclass adds an additional property, format String representing the ebook's format egPDF "ePUB"
Construct a variable named digitalRead of type Ebook, and instantiate it with an Ebook object that has the title "Advanced Java", pages, and is in the PDF format. Assume the Ebook subclass has a constructor EbookString title, int pages, String format
Secondly, write a statement to declare an int variable named objectPages and set it to the attribute pages of the digitalRead object dont use the hardcoded value here, but access the object property
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
