Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

calculate sum of integers using java stream

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