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

题目内容 (请给出正确答案)

1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()  

  • A、 Compilation fails.
  • B、 The code runs without exception.
  • C、 An exception is thrown at line 7.
  • D、 An exception is thrown at line 2.

参考答案

更多 “1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()  A、 Compilation fails.B、 The code runs without exception.C、 An exception is thrown at line 7.D、 An exception is thrown at line 2.” 相关考题
考题 classTestSuper{22.TestSuper(inti){}3.}4.classTestSubextendsTestSuper{}5.classTestAll{6.publicstaticvoidmain(String[]args){7.newTestSub();8.}9.}Whichistrue?() A.Compilationfails.B.Thecoderunswithoutexception.C.Anexceptionisthrownatline7.D.Anexceptionisthrownatline2.

考题 现有: 1.class Passer f 2.static final int X=5; 3.public static void main (String [] args) { 4.new Passer( ).go (x); 5.System. out .print (x); 6. ) 7.void go (int x) { 8.System. out .print(x++); 9.} 10.}结果是什么?()A、55B、56C、65D、66

考题 单选题现有:  1.class SuperFoo{  2.SuperFoo doStuff (int x)  {      3.return new SuperFoo();      4.    }      5.  }      6.  7. class Foo extends SuperFoo  {     8.    //insert code here     9.  }  和四个声明:   Foo doStuff (int x)  {  return new Foo();  }  Foo doStuff (int x)  {  return new SuperFoo();  }      SuperFoo doStuff(int x)  {  return new Foo();  }  SuperFoo doStuff(int y)  {  return new SuperFoo();  }    分别插入到第8行,有几个可以通过编泽?()A  1B  2C  3D  4

考题 单选题现有:  1.class Over  {  2.int dolt (long x)  {  return 3;  }      3.  }      4.  5. class Under extends Over  {      6.//insert code here      7.  }  和四个方法:  short dolt (int y)  {  return 4;  }  int dolt(long Xr long y)  {  return 4;  }      private int dolt(short y)  {  return 4;  }     protected int dolt (long x)  {  return 4;  }      分别插入到第6行,有几个可以通过编译?()A   1B   2C   3D   4

考题 单选题1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()A  Compilation fails.B  The code runs without exception.C  An exception is thrown at line 7.D  An exception is thrown at line 2.