8
What is the output of the following program?
import java.util.*;
public class Main {
public static void main(String[] args) {
List<Integer> nums = List.of(1, 2, 3, 4, 5);
System.out.println(nums.stream().filter(n -> n % 2 == 1).mapToInt(n -> n).sum());
}
}Easy