Q. What is the purpose of the reduce() method in a stream pipeline?
β
Correct Answer: (B)
To terminate the stream and return a single result
Explanation: The reduce() method combines the elements of a stream into a single result using a specified binary operator.