Multiple choice technology programming languages

class C1 { static class C2 { static int i1; } public static void main(String a[]) { System.out.println(C1.C2.i1); } } What is the result of attempting to compile and run the program?

  1. prints 0

  2. Compile time error

  3. Runtime exception

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The code compiles and runs successfully. Static int i1 is automatically initialized to 0 by Java. The class C2 is static and accessible via C1.C2 without needing an instance.