package foo; public class Outer (  public static class Inner (  )  )   Which statement is true? () A、 An instance of the Inner class can be constructed with “new Outer.Inner ()”B、 An instance of the inner class cannot be constructed outside of package foo.C、 An instance of the inner class can only be constructed from within the outer class.D、 From within the package bar, an instance of the inner class can be constructed with “new inner()”

package foo; public class Outer (  public static class Inner (  )  )   Which statement is true? () 

  • A、 An instance of the Inner class can be constructed with “new Outer.Inner ()”
  • B、 An instance of the inner class cannot be constructed outside of package foo.
  • C、 An instance of the inner class can only be constructed from within the outer class.
  • D、 From within the package bar, an instance of the inner class can be constructed with “new inner()”

相关考题:

以下程序的调试结果为?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.输出结果 OuterB.输出结果 InnerC.编译错误,因Inner类定义为私有访问D.在创建Inner类实例的行出现编译错误

Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()  A、Member variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.B、Member variables of the outer instance can never be referred to using only the variable name within  the inner instance.C、More than one inner instance can be associated with the same outer instance.D、All variables from the outer instance that should be accessible in the inner instance must be declared  final.E、A class that is declared final cannot have any inner classes.

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 3B、 new Inner(); // At line 8C、 new o.Inner(); // At line 8D、 new Outer.Inner(); // At line 8

Which two statements are true?()A、 An inner class may be declared as static.B、 An anonymous inner class can be declared as public.C、 An anonymous inner class can be declared as private.D、 An anonymous inner class can extend an abstract class.E、 An anonymous inner class can be declared as protected.

package foo;  public class Outer {  public static class Inner {  }  }   Which statement is true?() A、 Compilation fails.B、 An instance of the Inner class can be constructed with “new Outer.Inner()”.C、 An instance of the Inner class cannot be constructed outside of package foo.D、 An instance of the Inner class can be constructed only from within the Outer class.E、 From within the package foo, and instance of the Inner class can be constructed with “new Inner()”.

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.

Which the following two statements are true?()A、 An inner class may be declared as static.B、 An anonymous inner class can be declared as public.C、 An anonymous inner class can be declared as private.D、 An anonymous inner class can extend an abstract class.E、 An anonymous inner class can be declared as protected.

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?()A、 static class InnerOne {  public double methoda() {return d1;}  }B、 static class InnerOne {  static double methoda() {return d1;}  }C、 private class InnerOne {  public double methoda() {return d1;}  }D、 protected class InnerOne {  static double methoda() {return d1;}  }E、 public abstract class InnerOne {  public abstract double methoda();  }

Which statement 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 members of a static inner class can be referenced using the class name of the static inner class.

package geometry;  public class Hypotenuse {  public InnerTriangle it = new InnerTriangle();  class InnerTriangle {  public int base;  public int height;  }  }  Which is true about the class of an object that can reference the variable base? ()A、 It can be any class.B、 No class has access to base.C、 The class must belong to the geometry package.D、 The class must be a subclass of the class Hypotenuse.

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?()A、 InsideOnew ei= eo.new InsideOn();B、 Eo.InsideOne ei = eo.new InsideOne();C、 InsideOne ei = EnclosingOne.new InsideOne();D、 EnclosingOne.InsideOne ei = eo.new InsideOne();

Which statements about static inner classes are true?()A、 A static inner class requires a static initializer.B、 A static inner class requires an instance of the enclosing class.C、 A static inner class has no reference to an instance of the enclosing class.D、 A static inner class has access to the non-static members of the outer class.E、 Static members of a static inner class can be referenced using the class name of the static inner  class.

Which statement is true?()A、 An anonymous inner class may be declared as final.B、 An anonymous inner class can be declared as private.C、 An anonymous inner class can implement multiple interfaces.D、 An anonymous inner class can access final variables in any enclosing scope.E、 Construction of an instance of a static inner class requires an instance of the enclosing outer class.

1. public class enclosingone (  2. public class insideone{}  3. )  4. public class inertest(  5. public static void main (string[]args)(  6. enclosingone eo= new enclosingone ();  7. //insert code here  8. )  9. )    Which statement at line 7 constructs an instance of the inner class?()  A、 InsideOnew ei= eo.new InsideOn();B、 Eo.InsideOne ei = eo.new InsideOne();C、 InsideOne ei = EnclosingOne.new InsideOne();D、 EnclosingOne.InsideOne ei = eo.new InsideOne();

单选题package geometry;  public class Hypotenuse {  public InnerTriangle it = new InnerTriangle();  class InnerTriangle {  public int base;  public int height;  }  }  Which is true about the class of an object that can reference the variable base? ()A It can be any class.B No class has access to base.C The class must belong to the geometry package.D The class must be a subclass of the class Hypotenuse.

单选题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 3B new Inner(); // At line 8C new o.Inner(); // At line 8D new Outer.Inner(); // At line 8

单选题package foo;  public class Outer {  public static class Inner {  }  }   Which statement is true?()A Compilation fails.B An instance of the Inner class can be constructed with “new Outer.Inner()”.C An instance of the Inner class cannot be constructed outside of package foo.D An instance of the Inner class can be constructed only from within the Outer class.E From within the package foo, and instance of the Inner class can be constructed with “new Inner()”.

单选题Which statement is true?()A An anonymous inner class may be declared as final.B An anonymous inner class can be declared as private.C An anonymous inner class can implement multiple interfaces.D An anonymous inner class can access final variables in any enclosing scope.E Construction of an instance of a static inner class requires an instance of the enclosing outer class.

多选题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?()Astatic class InnerOne {  public double methoda() {return d1;}  }Bstatic class InnerOne {  static double methoda() {return d1;} }Cprivate class InnerOne {  public double methoda() {return d1;} }Dprotected class InnerOne {  static double methoda() {return d1;} }Epublic abstract class InnerOne {  public abstract double methoda();  }

多选题Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()AMember variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.BMember variables of the outer instance can never be referred to using only the variable name within  the inner instance.CMore than one inner instance can be associated with the same outer instance.DAll variables from the outer instance that should be accessible in the inner instance must be declared  final.EA class that is declared final cannot have any inner classes.

多选题Which two statements are true?()AAn inner class may be declared as static.BAn anonymous inner class can be declared as public.CAn anonymous inner class can be declared as private.DAn anonymous inner class can extend an abstract class.EAn anonymous inner class can be declared as protected.

单选题Which statement 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 members of a static inner class can be referenced using the class name of the static inner class.

多选题Which statements about static inner classes are true?()AA static inner class requires a static initializer.BA static inner class requires an instance of the enclosing class.CA static inner class has no reference to an instance of the enclosing class.DA static inner class has access to the non-static members of the outer class.EStatic members of a static inner class can be referenced using the class name of the static inner  class.

单选题package foo; public class Outer (  public static class Inner (  )  )   Which statement is true? ()A An instance of the Inner class can be constructed with “new Outer.Inner ()”B An instance of the inner class cannot be constructed outside of package foo.C An instance of the inner class can only be constructed from within the outer class.D From within the package bar, an instance of the inner class can be constructed with “new inner()”

单选题1. public class enclosingone (  2. public class insideone{}  3. )  4. public class inertest(  5. public static void main (string[]args)(  6. enclosingone eo= new enclosingone ();  7. //insert code here  8. )  9. )    Which statement at line 7 constructs an instance of the inner class?()A InsideOnew ei= eo.new InsideOn();B Eo.InsideOne ei = eo.new InsideOne();C InsideOne ei = EnclosingOne.new InsideOne();D EnclosingOne.InsideOne ei = eo.new InsideOne();

多选题Which the following two statements are true?()AAn inner class may be declared as static.BAn anonymous inner class can be declared as public.CAn anonymous inner class can be declared as private.DAn anonymous inner class can extend an abstract class.EAn anonymous inner class can be declared as protected.

单选题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.