Multiple Choice Question

Quiz Guidelines

 

QID: 
119
Question: 

Consider the following class...

class TestClass{
void probe(int... x) { System.out.println("In ..."); } //1
void probe(Integer x) { System.out.println("In Integer"); } //2
void probe(long x) { System.out.println("In long"); } //3
void probe(Long x) { System.out.println("In LONG"); } //4
public static void main(String[] args){
Integer a = 4; new TestClass().probe(a); //5
int b = 4; new TestClass().probe(b); //6
}
}

What will it print when compiled and run?

Select 2 options

A. In Integer and In long
B. In ... and In LONG, if //2 and //3 are commented out.
C. In Integer and In ..., if //4 is commented out.
D. It will not compile, if //1, //2, and //3 are commented out.
E. In LONG and In long, if //1 and //2 are commented out.

Q&A Set: