Programming using Java 8 Streams
Aug 5, 2023 · 3 min read · Sum of numbers in Array List using Streams List<Integer> al= Arrays.asList(10,45,20,30); int x=al.stream().reduce(10,(a,b)->a+b); System.out.println(x); in the above code snippet reduce function will calculate the sum of numbers , and first argument...
Join discussion