Q. Choose all the lines which if inserted independently instead of "//insert code here" will allow the following code to compile:
public class Test{
public static void main(String args[]){
add();
add(1);
add(1, 2);
}
// insert code here
}
public class Test{
public static void main(String args[]){
add();
add(1);
add(1, 2);
}
// insert code here
}
β
Correct Answer: (D)
static void add(int...args){}
Explanation: var-args = variable number of arguments = 0 or many