criskgl
7/11/2019 - 12:56 PM

sum of elements in List<Integer>

Arraylist<Integer> list = new ArrayList<Integer>();
int sum = list.stream().mapToInt(Integer::intValue).sum();