Programming using Java 8 Streams
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...
sunilkiran.hashnode.dev3 min read