Question
Language: Java Create an abstract base class person. Person Object will have the following member fields: Name, ID, Address. Address class: Street, city, zip code,
Language: Java
Create an abstract base class person. Person Object will have the following member fields: Name, ID, Address.
Address class: Street, city, zip code, country. The usage of the address class is the form of composition.
Create 2 concrete classes from an abstract person class employee class and student class.
Employee class with have the additional field: salary/ssn. for ssn we perform get on ssn it will only return the last 4 diigiys in the following format ###-##-1234
student class will have more fields: gpa/# of credits completed
To test created class, create an application only class with public void main (string [] args) method. app class should create 5 instances of employee and 20 instances of a student.
print name/salary of all employees. print the name, address & gpa of all created students.
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