-
In the below code, which call to num() method is appropriate?
class Result
{
public static int num(int ...x)
{
return;
}
static void main(String args[])
{
num(10);
num(10,20);
num(10,20,30);
num(10,20,30,40);
}
}
-
- only num(10,20)
- only num(10)
- only num(10) & num(10,20)
- all of the mentioned
- None of these
Correct Option: D
sum is a variable argument method and hence it can take any number as argument.