多项选择题
Given:
3. class Tire {
4. private static int x = 6;
5. public static class Wheel {
6. void go() {System.out.print("roll " + x++); }
7. } }
8. public class Car {
9. public static void main(String[] args) {
10. // insert code here
11. } }
And the three code fragments:
Ⅰ. new Tire.Wheel().go();
Ⅱ. Tire t = new Tire(); t.Wheel().go();
Ⅲ. Tire.Wheel w = new Tire.Wheel(); w.go();
Assuming we insert a single fragment at line 10, which are true (Choose all that apply.)
A.Once compiled, the output will be "roll 6"
B.Once compiled, the output will be "roll 7"
C.Fragment Ⅰ, inserted at line 10, will compile.
D.Fragment Ⅱ, inserted at line 10, will compile.
E.Fragment Ⅲ, inserted at line 10, will compile.
F.Taken separately, class Tire will not compile on its own.