Question
EASY JAVA PROGRAMMING I NEED IT IN AN HOUR PLEASE Implement the following classes: 1. Class Person (abstract superclass) protected member variable id of type
EASY JAVA PROGRAMMING
I NEED IT IN AN HOUR PLEASE
Implement the following classes:
1. Class Person (abstract superclass)
protected member variable id of type int.
A constructor which initializes id.
2. Class Employee (subclass of Person)
Private member variable name of type String.
Overloaded constructors
One constructor takes no input. Default name: "", Default ID: "0"
Another constructor takes in two parameters, for name and id.
Initialization: name initialization is done by Employee constructor; id initialization is done by the Person constructor.
Overrides equals method of the Object class that will compare two employees
Two employees are the same if they have same id and name.
3. Class EmployeeApp which has a main method
Ask users for the number of employees
Create an Employee array based on the given number
Accepts user input for name and id for all employees; creates Employee objects and stores their references in the array. Use the constructor to initialize the objects.
Using the equals method you implemented to find duplicate employee data in the array.
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