当前位置:SCJP程序员认证考试题库

问题:

[单选]

11. class Cup { } 
12. class PoisonCup extends Cup { } 
21. public void takeCup(Cup c) { 
22. if(c instanceof PoisonCup) { 
23. System.out.println(”Inconceivable!”); 
24. } else if(c instanceof Cup) { 
25. System.out.println(”Dizzying intellect!”); 
26. } else { 
27. System.exit(0); 
28. } 
29. } 
And the execution of the statements: 
Cup cup = new PoisonCup();
takeCup(cup); 
What is the output?() 

A .  Inconceivable!
B .  Dizzying intellect!
C .  The code runs with no output.
D .  An exception is thrown at runtime.
E .  Compilation fails because of an error in line 22.

1904年语文学科独立之时,语文课程名称为()和()。 自动调节系统的主要特点是什么? 中国古代选官的理论包含()。 德行观。 人才观。 用人观。 廉洁观。 信访制度解决农村纠纷的作用和限度 气浮池正常运行时,应建立2-4小时刮渣一次的制度。

11. class Cup { } 
12. class PoisonCup extends Cup { } 
21. public void takeCup(Cup c) { 
22. if(c instanceof PoisonCup) { 
23. System.out.println(”Inconceivable!”); 
24. } else if(c instanceof Cup) { 
25. System.out.println(”Dizzying intellect!”); 
26. } else { 
27. System.exit(0); 
28. } 
29. } 
And the execution of the statements: 
Cup cup = new PoisonCup();
takeCup(cup); 
What is the output?() 

参考答案:

  参考解析

本题暂无解析

在线 客服