Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java reduce sum

//for array
Stream.of(new int[]{3,4,5}).reduce(0, (a,b)->a+b) 
//or if a list
list.stream().reduce(0, Integer::sum)  
 
PREVIOUS NEXT
Tagged: #java #reduce #sum
ADD COMMENT
Topic
Name
2+7 =