试题详情
单项选择题 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.

  • A
  • 关注下方微信公众号,在线模考后查看

热门试题