6
What is the output of the following program?
public class Main {
public static void main(String[] args) {
java.util.List<Integer> nums = java.util.List.of(1, 2, 3);
int s = 0;
for (int n : nums) s += n;
System.out.println(s);
}
}Easy