P

Pushkar • 380 Points
Valuable

Q. What is the purpose of the peek() method in a stream pipeline?

  • (A) To modify the stream elements
  • (B) To inspect the stream elements
  • (C) To terminate the stream
  • (D) To filter the stream elements
  • Correct Answer - Option(B)
  • Views: 101
  • Filed under category JAVA

Explanation by: Pushkar
The peek() method allows you to perform a side-effect on each element of the stream without modifying the stream itself.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics