What is the output of the following program
public class
Test {
private int i = giveMeJ();
private int j = 10;
private int giveMeJ() {
return j;
}
public static void main(
String args[]) {
System.out.println((new Test()).i);
}
}
Select one correct answer
OPT:a. Compiler error complaining about access restriction of private variables of AQuestion.
OPT:b. Compiler error complaining about forward referencing.
OPT:c. No Compilation error - The output is 0;
OPT:d. No Compilation error - The output is 10;
ANS:c, I think the answer should be d, but the compiler also supports c, plz help me