in Education by (55.8k points)

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

1 Answer

0 votes
by (55.8k points)

Following code will print the highest number present in a list.

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

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

System.out.println("Lowest number in List : " + stats.getMin());

Related questions

0 votes
asked Feb 28 in Education by JackTerrance (1.9m points)
0 votes
asked Nov 16, 2021 in Education by JackTerrance (1.9m points)
...