Question File
Question File
empId
empName
city
Create class EmployeeDemo with main method. This Class EmployeeDemo will have
following two methods:
1. searchEmployee
This method will take an ArrayList of Employee Class Objects as its first parameter
and a single Employee Object as its second parameter. The method will search if the
Employee Object is present in the ArrayList of Employees or not based on empId. If it is
present, the method will return true else the method will return false.
2. getEmployees
This method will an ArrayList of Employee Class Objects as its first parameter and a
name of City of String datatype as its second parameter. The method will count the
number of employees in the ArrayList belonging to this city. The method returns 0, if
no employee in the ArrayList belong to the given city else returns the count of the
number of employees in the ArrayList belonging to this city.
Follow class outline diagram as given below. Ensure class attributes are private and other
methods are public. Use package “com” to build your solution.