R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `distinct()` do in a Stream?

  • (A) Sorts the stream
  • (B) Filters out duplicate elements
  • (C) Maps elements
  • (D) Returns the last element
  • Correct Answer - Option(B)
  • Views: 7
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`distinct()` returns a stream with duplicate elements removed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.