0
List<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

Open 1 Answers 40 Views Education

List<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

1 Answer

0

List<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

IntSummaryStatistics stats = integers.stream().mapToInt((x) -> x).summaryStatistics();

System.out.println("Sum of all numbers : " + stats.getSum());

by (53.7k points)
...