Static Nested Class 和 Inner Class的不同,说得越多越好
第1题:
Which two statements are true?()
第2题:
Which thefollowingstatements about static inner classes is true?()
第3题:
下列是抽象类的声明的是()
第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题:
public class enclosingone ( public class insideone{} ) public class inertest( public static void main (stringargs)( enclosingone eo= new enclosingone (); //insert code here ) ) Which statement at line 7 constructs an instance of the inner class?()
第6题:
Which statement is true?()
第7题:
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 "); } } 结果为:()
第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 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.
第13题:
package foo; public class Outer { public static class Inner { } } Which statement is true?()
第14题:
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true? ()
第15题:
Which the following two statements are true?()
第16题:
Which statement about static inner classes is true? ()
第17题:
Which statements about static inner classes are true?()
第18题:
Which declaration prevents creating a subclass of an outer class?()
第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题:
Word class.
Reading and speaking class.
Grammar class.
Phonetics class.
第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 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.