R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `allMatch()` do in a stream?

  • (A) Checks if all elements are equal
  • (B) Checks if all elements satisfy a condition
  • (C) Filters the matching elements
  • (D) Counts matching elements
  • Correct Answer - Option(B)
  • Views: 15
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`allMatch()` returns true if all stream elements match the given predicate.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.