Given the definition of the Employee class:
and this code fragment:What is the result?
Given the definition of the Employee class:
and this code fragment:What is the result?
The provided code sorts the employees first by department and then by name in ascending order. The Comparator first applies sorting by the department, so 'hr' comes before 'sales'. Then, within each department, it sorts by the name alphabetically. As a result, the sorted list of employees will be [hr:Bob, hr:Eva, sales:Ada, sales:Bob].
correct is D. Tested
D,tested
D is correct.
D, sort is ASC