Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a class Emp with the following fields - emp_id, name, salary, gender, department, and emailid. Also, define the corresponding constructors, and getter and setter

image text in transcribed
Define a class Emp with the following fields - emp_id, name, salary, gender, department, and emailid. Also, define the corresponding constructors, and getter and setter methods. Further, override the toString0 method to display the details of the employee. Now create another class EmpList, that has an ArrayList as its data member. In this class, define two methods - addEmp(Emp ob), and deleteEmp(int eid) that adds and removes an Emp object in the list. Also, create methods to display minimum salary, maximum salary, average salary, and search an employee using the given emp_id. Finally, test the program using the main() method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions