Question
LANGUAGE: JAVA create an abstract base class person that will have the following member fields: name, id, address. Address will be defined by address class
LANGUAGE: JAVA
create an abstract base class person that will have the following member fields: name, id, address.
Address will be defined by address class and necessary to define and address: street, city , zip code and country(country will have a default value USA
usage of address class in the person class is form of composition. Extending the abstract person class will create 2 non abstract classes: employee and student
Employee class: salary, social security nub (SSN). When we perform get on SSN it will only return the last 4 digits the following format (###-##-1234)
student class with have gpa and number of credits completed
to test, create an application class with public void main string method. it should create 5 instances. of employee and 5 of student class. use data structure such as list<>or[] to store the instances. Print (system.out.println) the name and salary of all employees. similar print the name, address and 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