Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 160

Given the definition of the Employee class:

and this code fragment:

What is the result?

    Correct Answer: D

    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].

Discussion
maslacOption: D

correct is D. Tested

Svetleto13Option: D

D,tested

steefaandOption: D

D is correct.

duydnOption: D

D, sort is ASC