R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method allows limiting the stream elements by a condition in Java 9+?

  • (A) filterWhile()
  • (B) limitIf()
  • (C) takeWhile()
  • (D) limitBy()
  • Correct Answer - Option(C)
  • Views: 4
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`takeWhile()` in Java 9+ allows limiting elements based on a condition.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.