Question: Which of the following declares a Comparator where all objects are treated as equal? A. Comparator comp = (c1) -> 0; B. Comparator comp =

Which of the following declares a Comparator where all objects are treated as equal?

A. Comparator comp = (c1) -> 0;

B. Comparator comp = (c1) -> {0};

C. Comparator comp = (c1, c2) -> 0;

D. Comparator comp = (c1, c2) -> {0};

E. None of the above.

Step by Step Solution

3.31 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The correct answer is C Comparator comp c1 c2 0 Explanation In Java a Comparator is a functional int... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!