Question: Q2. Implement the following inheritance hierarchy: a. Class Person has two fields, name and civil ld, constructor, getter and setter methods and toString method, which
Q2. Implement the following inheritance hierarchy: a. Class Person has two fields, name and civil ld, constructor, getter and setter methods and toString method, which returns a String containing the Person information. b. Class Student which is a sub-class of the Person class. Class Student has two fields, College and GPA, constructor (should calls the constructor of the super class), getter and setter methods and toString method (overridden) to return a String containing the student information. Class Faculty which is a sub-class of the Person class. Class Employee has two fields, Department and Salary, constructor (should calls the constructor of the super class), getter and setter methods and toString method (overridden) to return a String containing the Employee information. c. d. Write an application that creates objects of your classes and outputs each object's information
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
