For instance, my treeMap is set as <String key, String value>
if(employeeList.containsKey(searchKey)){
temp = "Employee: " + searchKey + ", Department: " +
departmentList.get(searchKey) + ", Salary: $" + employeeList.get(searchKey);
}
This loop obtains all the information associated to a specific key input by user. In my case, if I type the key (name of an employee) I would get his name, department, and salary.
Is there a way I can do the opposite? So, can I type the department (value) and get all the names of the employees (key) associated with that department?