R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the result of `stream.sorted().findFirst()`?

  • (A) Optional of smallest element
  • (B) Optional of largest element
  • (C) Stream of first element
  • (D) List of one element
  • Correct Answer - Option(A)
  • Views: 11
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`sorted()` arranges elements and `findFirst()` gives the smallest in natural order.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.