易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

class One {  public One() { System.out.print(1); }  }  class Two extends One {  public Two() { System.out.print(2); }  }  class Three extends Two {  public Three() { System.out.print(3); }  }  public class Numbers{  public static void main( String[] argv) { new Three(); }  }  What is the result when this code is executed?() 

A、 1

B、 3

C、 123

D、 321

E、 The code rims with no output.

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • class Base {  Base() { System.out.print(“Base”); }  }  public class Alpha extends Base {  public static void main( String[] args ) {  new Alpha();  new Base();  }  }  What is the result?()  

    A、 Base

    B、 BaseBase

    C、 Compilation fails.

    D、 The code runs with no output.

    E、 An exception is thrown at runtime.

  • Runnable r = new Runnable() {  public void run() {  System.out.print(”Cat”);  }  };  Threadt=new Thread(r) {  public void run() {  System.out.print(”Dog”);  }  };  t.start();  What is the result?() 

    A、 Cat

    B、 Dog

    C、 Compilation fails.

    D、 The code runs with no output.

    E、 An exception is thrown at runtime.

  • int I=1, j=0   switch(i) {   case 2:   j+=6;   case 4:   j+=1;    default:    j +=2;   case 0:   j +=4;   }   What is the value of j at line 16?()

    A

     0

    B

     1

    C

     2

    D

     4

    E

     6

  • 16. Date d = new Date(0L);  17. String ds = “December 15, 2004”;  18. // insert code here  What updates d‟s value with the date represented by ds?()

    A、 18. d = df.parse(ds);

    B、 18. d = df.getDate(ds);

    C、 18. try { 19. d = df.parse(ds);  20. } catch(ParseException e) { };

    D、 18. try {  19. d = df.getDate(ds);  20. } catch(ParseException e) { };

  • 10. public class MyClass {  11.  12. public Integer startingI;  13. public void methodA() {  14. Integer i = new Integer(25);  15. startingI = i;  16. methodB(i);  17. }  18. private void methodB(Integer i2) {  19. i2 = i2.intValue();  20.  21. }  22. }  If methodA is invoked, which two are true at line 20?()

    A

     i2 == startingI returns true.

    B

     i2 == startingI returns false.

    C

     i2.equals(startingI) returns true.

    D

     i2.equals(startingI) returns false.

联系客服 会员中心
TOP