What is the output of the following code when compiled and run? Select two correct answers.
public class Question25 {
static class Question25Inner {private int i=2;}
static Question25Inner inner = new Question25Inner();
public static void main(
String[] args){
Question25[] q25 = new Question25[2];
for(int i=0;i<q25.length;i++)
q25[i] = new Question25();
q25[0].inner.i = 3;
System.out.println(q25[0].inner.i+","+q25[1].inner.i);
}
}
A. Prints: 3,2
B. Compilation error (i is not accessible).
C. Prints: 3,3
D. There are q25.length instances of class Question25Inner.
E. Question25Inner is called a "top-level nested class".
Explain me in detail.
pankaj shinde
[ October 29, 2007: Message edited by: Pankaja Shinde ]