Multiple Choice Question

Quiz Guidelines

 

QID: 
121
Question: 

Consider the following code:

public class Varargs{
public void test(){
test1(10); //1
test1(10, 20); //2
}
public static void main(String[] args){
new Varargs().test();
}
//insert method here.
}

Which of the following lines can be added independently to the above class so that it will run without any errors or exceptions?

Select 2 options

A. public void test1(int i, int j){}
B. public void test1(int i, int... j){}
C. public void test1(int... i){}
D. public void test1(int i...){}
E. public void test1(int[] i){}

Q&A Set: