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.
第1题:
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?()
第2题:
package foo; public class Outer { public static class Inner { } } Which statement 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题:
现有: class Birds { public static void main (String [] args) { try { throw new Exception () ; } catch (Exception e) { try { throw new Exception () ; } catch (Exception e2) { System.out.print ("inner "); } System. out.print ( "middle" ) ; } System.out.print ("outer") ; } } 结果是()
第7题:
Which of the following statements about variables and their scopes are true? ()
第8题:
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()”.
第9题:
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(); }
第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 two statements are true?()
第14题:
Which thefollowingstatements about static inner classes is true?()
第15题:
Which the following two statements are true?()
第16题:
Which statement about static inner classes is true? ()
第17题:
Which statement is true?()
第18题:
class Birds { public static void main(String [] args) { try { throw new Exception(); } catch (Exception e) { try { throw new Exception(); } catch (Exception e2) { System.out.print("inner "); } System.out.print("middle "); } System.out.print("outer "); } } 结果为:()
第19题:
new Inner(); // At line 3
new Inner(); // At line 8
new o.Inner(); // At line 8
new Outer.Inner(); // At line 8
第20题:
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.
第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题:
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 only be constructed from within the outer class.
From within the package bar, an instance of the inner class can be constructed with “new inner()”