R

Ram Sharma • 3.40K Points
Extraordinary

Q. How many times does `peek()` execute?

  • (A) Only on terminal operation
  • (B) Once per stream call
  • (C) Only when stream is sorted
  • (D) Unlimited
  • Correct Answer - Option(A)
  • Views: 4
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`peek()` is lazy and only executes when a terminal operation is called.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.