R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method is used to sort a stream using a custom comparator?

  • (A) stream.sort()
  • (B) sortWith()
  • (C) sorted(Comparator)
  • (D) sortBy()
  • Correct Answer - Option(C)
  • Views: 3
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`sorted(Comparator)` allows sorting a stream using a custom comparator.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.