R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method terminates the stream and performs action on each element?

  • (A) map()
  • (B) peek()
  • (C) forEach()
  • (D) filter()
  • Correct Answer - Option(C)
  • Views: 9
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`forEach()` is a terminal operation that applies an action to each stream element.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.