R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which terminal operation returns an Optional?

  • (A) filter()
  • (B) findFirst()
  • (C) sorted()
  • (D) map()
  • Correct Answer - Option(B)
  • Views: 9
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`findFirst()` returns an `Optional` describing the first element of the stream.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.