Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java stream sum integers

List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5);
Integer sum = integers.stream()
  .reduce(0, Integer::sum);
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #java #stream #sum #integers
ADD COMMENT
Topic
Name
3+2 =