Multiple choice technology programming languages

class C1 { static interface I { static class C2 { } } public static void main(String a[]) { C1.I.C2 ob1=new C1.I.C2(); System.out.println("object created"); } } What is the result of attempting to compile and run the program?

  1. prints object created

  2. Compile time error

  3. Runtime Excepion

  4. None of the above

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

This code is valid Java. A static interface can contain static member classes, and C1.I.C2 refers to that nested class. The object creation using new C1.I.C2() is valid syntax, and the program compiles and runs successfully, printing 'object created'.