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

Java allows static nested classes inside interfaces. The syntax C1.I.C2 is valid - C2 is a static class inside interface I, which is inside class C1. The code compiles successfully and creates the object, printing 'object created'. No compile-time or runtime errors occur.