Multiply all the values of the following list using a stream:
List<Integer> list = List.of(2, 3, 4);
Multiply all the values of the following list using a stream:
List<Integer> list = List.of(2, 3, 4);
int r = list.stream().reduce(1, (x, y) -> x * y);
System.out.println(r); //prints: 24