欢迎来到PP题库网 PP题库官网
logo
全部科目 > Java认证考试 > 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.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题