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