Multiple Choice
Complete the code to sort the employees collection by salary using a Comparator.Assume the method getSalary that returns an employee's salary as an integer.
Collections.sort(employees, _____________________________________) ;
A) Comparator.comparing(Employee::getSalary)
B) Comparator.comparing(Employee::getSalary() )
C) Comparator.thenComparing(Employee::getSalary)
D) Comparator.comparing(e -> e.getSalary)
Correct Answer:

Verified
Correct Answer:
Verified
Q20: What is the type returned by the
Q21: Complete the following code snippet that returns
Q22: You want to save stream values in
Q23: Complete the following statement that finds the
Q24: Complete the following code snippet to determine
Q26: Which lambda expression represents a function that
Q27: Which of the following statements related to
Q28: Complete the code to sort the employees
Q29: Complete the following statement that uses streams
Q30: Complete the following code snippet to find