Question: Creating Class Hierarchy (Inheritance) Create a Java class with two subclasses (children). Each class should have at least one attribute and a method. Parent class
Creating Class Hierarchy (Inheritance)
Create a Java class with two subclasses (children). Each class should have at least one attribute and a method. Parent class should have the attribute/method that is common to both children and children should have the attribute/method that is unique to what they represent. Write the main method to demonstrate the correct functionality of the code and to demonstrate that the children inherit from the parent class.
Provide Java code with explanation please.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
