Given:
3. class Shape { 4. private static int x = 6; 5. public static class MyClass { 6. void go() { System.out.print("roll " + x++); } 7. } } 8. public class Main { 9. public static void main(String[] args) { 10. // insert code here 11. } }
And the three code fragments:
MyClass()
.go()
;Shape()
; t.MyClass()
.go()
;MyClass()
; w.go()
;Assuming we insert a single fragment at line 10, which are true? (Choose all that apply.)
A, C, and E are correct.
The weird, static-specific syntax to use so-called "static inner classes" from outside the enclosing class is demonstrated with fragments I and III.