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

Open 1 Answers 16 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("Average of all numbers : " + stats.getAverage());

by (53.7k points)
...