Question: 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
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
Get step-by-step solutions from verified subject matter experts
