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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!