Question
Implement a super class Person. Make two classes, Student and instructor, inherit from Person. A person has a name and a year of birth. A
Implement a super class Person. Make two classes, Student and instructor, inherit from Person. A person has a name and a year of birth. A student has a major and an instructor has a salary. Write the class definitions, the constructors, and the methods toString() and equals() for all classes. Supply a test program that test these classes and methods. In the test class, use your imaginations to create person objects, students objects and instructor objects. Print these objects and compare them. Please note that part of the output is shown below only
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started