10
What is the output of the following program?
public class Main {
static double sum(java.util.List<? extends Number> list) {
double s = 0;
for (Number n : list) s += n.doubleValue();
return s;
}
public static void main(String[] args) {
System.out.println(sum(java.util.List.of(1, 2, 3)));
}
}Medium