Home / Programming MCQs / JAVA MCQs / Question


Pushkar • 380 Points

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


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


Login to discuss.