网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100?()
A

n = 100;

B

i.setX( 100 );

C

o.getY().setX( 100 );

D

i = new Inner(); i.setX( 100 );

E

o.setY( i ); i = new Inner(); i.setX( 100 );

F

i = new Inner(); i.setX( 100 ); o.setY( i );


参考答案

参考解析
解析: 暂无解析
更多 “多选题Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100?()An = 100;Bi.setX( 100 );Co.getY().setX( 100 );Di = new Inner(); i.setX( 100 );Eo.setY( i ); i = new Inner(); i.setX( 100 );Fi = new Inner(); i.setX( 100 ); o.setY( i );” 相关考题
考题 Which two code fragments correctly create and initialize a static array of int elements() A.static final int[]a={100,200};B.static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}C.static final int[]a=new int[2]{100,200};D.static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}

考题 Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100?() A.n = 100;B.i.setX( 100 );C.o.getY().setX( 100 );D.i = new Inner(); i.setX( 100 );E.o.setY( i ); i = new Inner(); i.setX( 100 );F.i = new Inner(); i.setX( 100 ); o.setY( i );

考题 Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result? () A.Compilation fails.B.ClassC is displayed.C.The code runs with no output.D.An exception is thrown at runtime.

考题 Click the Exhibit button. What is the output of the program shown in the exhibit?() A.300-100-100-100-100B.300-300-100-100-100C.300-300-300-100-100D.300-300-300-300-100

考题 当你编译运行下列程序代码,会得到什么结果?private class Base{ Base(){ int i = 100; System.out.println(i); } }public class Pri extends Base{ staticint i = 200;public static void main(String argv[]){ Pri p = new Pri(); System.out.println(i); } }A.这段代码不能通过编译B.输出200C.输出100和200D.输出100

考题 以下程序的调试结果为?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类实例的行出现编译错误

考题 以下程序调试结果为:class Base{Base(){int i = 100;System.out.print (i);}}public class Pri extends Base{static int i = 200;public static void main(String argv[]){Pri p = new Pri();System.out.print(i);}} A.编译错误B.200C.100200D.100

考题 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 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();   }   }  A、c = b;B、c = this.a;C、c = this.b;D、c = Q4a39.this.a;E、c = c;

考题 下面哪一个是合法的数组声明和构造语句()A、 int[] ages = [100];B、 int ages = new int[100];C、 int[] ages = new int[100];D、 int() ages = new int(100);

考题 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()”

考题 class Foo {  private int x;  publicFoo(intx) {this.x=x; }  public void setX( int x) { this.x = x; }  public int getX() { return x; }  }   public class Gamma {  static Foo fooBar( Foo foo) {  foo = new Foo( 100);  return foo;  }  public static void main( String[] args) {  Foo foo = new Foo( 300);  System.out.print( foo.getX() + “-“);  Foo fooFoo = fooBar( foo);  System.out.print( foo.getX() + “-“);  System.out.print( fooFoo.getX() + “-“);  foo = fooBar( fooFoo);  System.out.print( foo.getX() + “-“);  System.out.prmt( fooFoo.getX());  }  }  What is the output of this program?()A、 300-100-100-100-100B、 300-300-100-100-100C、 300-300-300-100-100D、 300-300-300-300-100

考题 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();

考题 10. class Inner {  11. private int x;  12. public void setX( int x) { this.x = x; }  13. public int getX() { return x; }  14. }  15.  16. class Outer {  17. private Inner y;  18. public void setY( Inner y) { this.y = y; }  19. public Inner getY() { return y; }  20. }  21.  22. public class Gamma {  23. public static void main( String[] args) { 24. Outer o = new Outer(); 25. Inner i = new Inner();  26.int n=10;  27. i.setX(n);  28. o.setY(i);  29. // insert code here  30. System.out.println( o.getY().getX());  31. }  32. }  Which three code fragments, added individually at line 29, produce the output 100?()A、 n = 100;B、 i.setX( 100);C、 o.getY().setX( 100);D、 i = new Inner(); i.setX( 100);E、 o.setY( i); i = new Inner(); i.setX( 100);F、 i = new Inner(); i.setX( 100); o.setY( i);

考题 Consider the following class:     class Test(int i) {     void test(int i) {  System.out.println(“I am an int.”); }    void test(String s) {   System.out.println(“I am a string.”);     }          public static void main(String args) {    Test t=new Test();     char ch=“y”;    t.test(ch);     }      }     Which of the statements below is true?()A、 Line 5 will not compile, because void methods cannot be overridden.B、 Line 12 will not compile, because there is no version of test() that rakes a charargument.C、 The code will compile but will throw an exception at line 12.D、 The code will compile and produce the following output: I am an int.E、 The code will compile and produce the following output: I am a String.

考题 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 ");  }  }  结果为:()  A、innerB、inner outerC、middle outerD、inner middle outer

考题 Which two code fragments correctly create and initialize a static array of int elements?()A、static final int[] a = { 100,200 };B、static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }C、static final int[] a = new int[2]{ 100,200 };D、static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }

考题 单选题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()”.

考题 多选题10. class Inner {  11. private int x;  12. public void setX( int x) { this.x = x; }  13. public int getX() { return x; }  14. }  15.  16. class Outer {  17. private Inner y;  18. public void setY( Inner y) { this.y = y; }  19. public Inner getY() { return y; }  20. }  21.  22. public class Gamma {  23. public static void main( String[] args) { 24. Outer o = new Outer(); 25. Inner i = new Inner();  26.int n=10;  27. i.setX(n);  28. o.setY(i);  29. // insert code here  30. System.out.println( o.getY().getX());  31. }  32. }  Which three code fragments, added individually at line 29, produce the output 100?()An = 100;Bi.setX( 100);Co.getY().setX( 100);Di = new Inner(); i.setX( 100);Eo.setY( i); i = new Inner(); i.setX( 100);Fi = new Inner(); i.setX( 100); o.setY( i);

考题 多选题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();   }   }Ac = b;Bc = this.a;Cc = this.b;Dc = Q4a39.this.a;Ec = c;

考题 单选题Click the Exhibit button.   What is the output of the program shown in the exhibit? ()A  300-300-100-100-100B  300-300-300-100-100C  300-300-300-300-100D  300-100-100-100-100

考题 单选题Click the Exhibit button.   Given: ClassA a = new ClassA();   a.methodA();   What is the result?()A  The code runs with no output.B  Compilation fails.C  An exception is thrown at runtime.D  ClassC is displayed.

考题 多选题Which two code fragments correctly create and initialize a static array of int elements()Astatic final int[]a={100,200};Bstatic final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}Cstatic final int[]a=new int[2]{100,200};Dstatic final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}

考题 单选题Click the Exhibit button. In the exhibit, what is the priority for Router B in VRRP group 100?()A 1B 100C 110D 255

考题 单选题下面哪一个是合法的数组声明和构造语句()A int[]ages=[100];B int ages=new int[100];C int[]ages=new int[100];D int()ages=new int(100);