What does the filter() method do in a Stream?
Correct answer
Filters based on a condition
Explanation
filter() is used to retain elements that match a given predicate.
Update: Admin added a tag on this question
Topics
By Admin · · 29 views