Which method reference is ideal for sorting a list of integers?

  1. Math::max
  2. Integer::compareTo
  3. Integer::sum
  4. Integer::parseInt
Correct answer Integer::compareTo

Explanation

`Integer::compareTo` can be used to compare integers.

Update: Admin added a tag on this question

Topics

By Admin · · 30 views