P

Pushkar • 380 Points
Valuable

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

  • (A) To transform a stream into a new stream
  • (B) To terminate the stream and return a single result
  • (C) To filter the stream elements
  • (D) To perform a side-effect on the stream elements
  • Correct Answer - Option(B)
  • Views: 122
  • Filed under category JAVA

Explanation by: Pushkar
The reduce() method combines the elements of a stream into a single result using a specified binary operator.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics