Question: Create an abstract class named Publication. This class should define an abstract method getPublicationType ( ) and a nonabstract method getTitle ( ) that returns

Create an abstract class named Publication. This class should define an abstract method getPublicationType() and a nonabstract method getTitle() that returns the value of a title data field as well as a setTitle() method used to set the title data field. The toString() method of the Publication class should concatenate the result of getPublicationType() with getTitle(). Create two subclasses of PublicationMagazine and Bookthat each implement the getPublicationType() method. Finally, create a PublicationDemo class with a main() method that creates an instance of both Magazine and Book, and prints the result of the toString() method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!