Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions