Sepehr Sobhani Sepehr Sobhani - 8 months ago 14
Java Question

Get the product of a list using java Lambdas

How do you get the product of a array using java Lambdas. I know in C# it is like this:

result = array.Aggregate((a, b) => b * a);


edit: made the question more clear.

Answer
list.stream().reduce(1, (a, b) -> a * b);