(Choose 1 answer)
class Output {
What will be the output of the following Java program?
public static int sum(int... nums) {
int sum = 0;
for (int x: nums) {
sum += x;
} return sum;
}
public static void main(String args[]) {
sum(10);
sum(10, 20);
System.out.println(sum (10, 20));
}
}
A. 10
B. 10, 10, 20
C. 30
D. Compiler error
Osh