试题详情
- 单项选择题 1. class A { 2. public byte file Number ( ) { 3. return l; 4. } 5. } 6. 7. Class B extends A { 8. public short getNumber( ) { 9. return 2; 10. } 11. 12. public short getNumber( ) { 13. B b = new B( ); 14. System.out.printIn(b.getNumber( )); 15. } 16. } What is the result()?
A、 Compilation succeeds and l is printed.
B、 Compilation succeeds and 2 printed.
C、 An error at line 8 cause compilation to fail.
D、 An error at line 14 cause complication to fail.
E、 Complication succeeds but an exception is thrown at line 14.
- C
关注下方微信公众号,在线模考后查看
热门试题
- After execution
- 面向对象的程序设计方法有哪些优点?
- 如何在退出程序时提示保存修改内容?()
- 在JAVA中,如何获得一个子目录下的文件
- public class&e
- public class&e
- 已知: 要使用类B通过编译,只需要修改
- 数组元素怎样进行缺省的初始化?
- 为student类定义构造方法初始化所有
- 有一分数序列:2/1,3/2,5/3,8
- HashMap和HashTable的描述
- public c
- 1. class
- 数据类型包装类与基本数据类型有什么关系?
- 现有: import&en
- 程序: cla
- 以下程序执行的结果是什么?()&ens
- 10. class&ensp
- 已知: 则输出为()
- Which three&ens