单项选择题

1. public class Outer{ 
2. public void someOuterMethod() { 
3. // Line 3 
4. } 
5. public class Inner{} 
6. public static void main( String[]argv ) { 
7. Outer o = new Outer(); 
8. // Line 8 
9. } 
10. } 
Which instantiates an instance of Inner?()  

A. new Inner(); // At line 3
B. new Inner(); // At line 8
C. new o.Inner(); // At line 8
D. new Outer.Inner(); // At line 8


您可能感兴趣的试卷

你可能感兴趣的试题

2.多项选择题In which two cases does the compiler supply a default constructor for class A?()  

A. class A{}
B. class A { public A(){} }
C. class A { public A(int x){} }
D. class Z {} class A extends Z { void A(){} }

6.单项选择题

1. public class A { 
2. void A() { 
3. System.out.println(“Class A”); 
4. } 
5. public static void main(String[] args) { 
6. new A(); 
7. } 
8. } 
What is the result?()  

A. Class A
B. Compilation fails.
C. An exception is thrown at line 2.
D. An exception is thrown at line 6.
E. The code executes with no output.