An inner class may be declared as static.
An anonymous inner class can be declared as public.
An anonymous inner class can be declared as private.
An anonymous inner class can extend an abstract class.
An anonymous inner class can be declared as protected.
第1题:
package foo; public class Outer { public static class Inner { } } Which statement is true?()
第2题:
Which thefollowingstatements about static inner classes is true?()
第3题:
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true? ()
第4题:
public class OuterClass { private double d1 1.0; //insert code here } You need to insert an inner class declaration at line2. Which two inner class declarations are valid?()
第5题:
Which statements about static inner classes are true?()
第6题:
AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. AnAdapter1 is a non-abstract, non-final class without a zero argument constructor, but with a constructor that takes one int argument. Which two construct an anonymous inner class?()
第7题:
An anonymous inner class may be declared as final.
An anonymous inner class can be declared as private.
An anonymous inner class can implement multiple interfaces.
An anonymous inner class can access final variables in any enclosing scope.
Construction of an instance of a static inner class requires an instance of the enclosing outer class.
第8题:
static class InnerOne { public double methoda() {return d1;} }
static class InnerOne { static double methoda() {return d1;} }
private class InnerOne { public double methoda() {return d1;} }
protected class InnerOne { static double methoda() {return d1;} }
public abstract class InnerOne { public abstract double methoda(); }
第9题:
c = b;
c = this.a;
c = this.b;
c = Q4a39.this.a;
c = c;
第10题:
An inner class may be declared as static.
An anonymous inner class can be declared as public.
An anonymous inner class can be declared as private.
An anonymous inner class can extend an abstract class.
An anonymous inner class can be declared as protected.
第11题:
A static inner class requires a static initializer.
A static inner class requires an instance of the enclosing class.
A static inner class has no reference to an instance of the enclosing class.
A static inner class has access to the non-static members of the outer class.
Static members of a static inner class can be referenced using the class name of the static inner class.
第12题:
An inner class may be declared as static.
An anonymous inner class can be declared as public.
An anonymous inner class can be declared as private.
An anonymous inner class can extend an abstract class.
An anonymous inner class can be declared as protected.
第13题:
Which statements can be inserted at the indicated position in the following code to make the program write 1 on the standard output when run?() public class Q4a39 { int a = 1; int b = 1; int c = 1; class Inner { int a = 2; int get() { int c = 3; // insert statement here return c; } } Q4a39() { Inner i = new Inner(); System.out.println(i.get()); } public static void main(String args[]) { new Q4a39(); } }
第14题:
Anonymous Inner Class(匿名内部类)是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?
第15题:
Which the following two statements are true?()
第16题:
Which statement about static inner classes is true? ()
第17题:
Which statement is true?()
第18题:
Compilation fails.
An instance of the Inner class can be constructed with “new Outer.Inner()”.
An instance of the Inner class cannot be constructed outside of package foo.
An instance of the Inner class can be constructed only from within the Outer class.
From within the package foo, and instance of the Inner class can be constructed with “new Inner()”.
第19题:
AnAdapter1 aa = new AnAdapter1 () {}
AnAdapter0 aa = new AnAdapter0 () {}
AnAdapter0 aa = new AnAdapter0 (5) {}
AnAdapter1 aa = new AnAdapter1 (5) {}
AnInterface ai = new Anlnterface (5)) {}
第20题:
第21题:
Member variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.
Member variables of the outer instance can never be referred to using only the variable name within the inner instance.
More than one inner instance can be associated with the same outer instance.
All variables from the outer instance that should be accessible in the inner instance must be declared final.
A class that is declared final cannot have any inner classes.
第22题:
An anonymous class can be declared as static.
A static inner class cannot be a static member of the outer class.
A static inner class does not require an instance of the enclosing class.
Instance members of a static inner class can be referenced using the class name of the static inner class.
第23题:
AnAdapter1 aa=new AnAdapter1(){}
AnAdapter0 aa=new AnAdapter0(){}
AnAdapter0 aa=new AnAdapter0(5){}
AnAdapter1 aa=new AnAdapter1(5){}
AnInterface a1=new AnInterface(5){}
第24题:
An anonymous class can be declared as static.
A static inner class cannot be a static member of the outer class.
A static inner class does not require an instance of the enclosing class.
Instance member of a static inner class can be referenced using the class name of the staticinner class.