单选题Which thefollowingstatements about static inner classes is true?()A
An anonymous class can be declared as static.B
A static inner class cannot be a static member of the outer class.C
A static inner class does not require an instance of the enclosing class.D
Instance member of a static inner class can be referenced using the class name of the staticinner class.
第1题:
以下程序的调试结果为?
public class Outer{
public String name = "Outer";
public static void main(String argv[]){
Inner i = new Inner();
i.showName();
}
private class Inner{
String name =new String("Inner");
void showName(){
System.out.println(name);
}
}
}
A.输出结果 Outer
B.输出结果 Inner
C.编译错误,因Inner类定义为私有访问
D.在创建Inner类实例的行出现编译错误
第2题:
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?()
第3题:
Static Nested Class 和 Inner Class 的不同。
参见前面的什么是内部类的那道题
第4题:
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true? ()
第5题:
package foo; public class Outer { public static class Inner { } } Which statement is true?()
第6题:
Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()
第7题:
Which two statements are true?()
第8题:
Static Nested Class 和 Inner Class的不同,说得越多越好
第9题:
Which thefollowingstatements about static inner classes is true?()
第10题:
Which the following two statements are true?()