R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `limit(n)` do in streams?

  • (A) Skips the first n elements
  • (B) Returns the last n elements
  • (C) Processes only the first n elements
  • (D) Removes the first n elements
  • Correct Answer - Option(C)
  • Views: 6
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`limit(n)` returns a stream consisting of the first n elements.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.