试题详情
- 单项选择题 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result?()
A、 The code runs with no output.
B、 An exception is thrown at runtime.
C、 Compilation fails because of an error in line 20.
D、 Compilation fails because of an error in line 21.
E、 Compilation fails because of an error in line 23.
F、 Compilation fails because of an error in line 25.
- F
关注下方微信公众号,在线模考后查看
热门试题
- 输入两个正整数m和n,求其最大公约数和最
- Which the two&
- 现有: &ens
- What is th
- class ClassA&e
- 列举java.awt.event包中定义
- Which two
- 函数调用的多态性涉及到程序运行时的后期绑
- 某二叉树的先根遍历序列和后根遍历序列正好
- Given: http://
- public static void
- Which statemen
- Assume that&en
- Which two̳
- class Beta&ens
- 说明抽象类和接口的异同。
- 11. class&ensp
- 用JBuilder建立图形界面程序的步骤
- Your company&e
- 对下面Spring声明式事务的配置含义的