QUESTION : 21
What is the output of the following program
1. public class
Test {
2. private int i = giveMeJ();
3. private int j = 10;
4.
5. private int giveMeJ() {
6. return j;
7. }
8.
9. public static void main(
String args[]) {
10. System.out.println((new AQuestion()).i);
11. }
12. }
Select one correct answer
a. Compile error complaining about access restriction of private variables of AQuestion
b. Compile error complaining about forward referencing.
c. No compile error. The output is 0
d. No compilation error - The output is 10
==========================================================================================
The given answer is 'c'
Please explain this someone!