A

Admin • 828.03K Points
Coach

Q. What does the filter() method do in a Stream?

  • (A) Filters based on a condition
  • (B) Sorts the stream
  • (C) Transforms data
  • (D) Reduces the stream

Explanation by: Admin
filter() is used to retain elements that match a given predicate.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.