Question: Create an abstract class AbstractClass with an abstract method printMessage. Create two subclasses each implementing the method printMessage that prints This is first subclass and
Create an abstract class AbstractClass with an abstract method printMessage. Create two subclasses each implementing the method printMessage that prints "This is first subclass "and " This is second subclass" respectively. Call the methods printMessage by creating an object for each subclass.
Step by Step Solution
3.49 Rating (159 Votes )
There are 3 Steps involved in it
To address this question we need to create a Java program that demonstrates the use of abstract classes and subclasses Here is a stepbystep explanatio... View full answer
Get step-by-step solutions from verified subject matter experts
