试题详情
- 单项选择题 11. abstract class Vehicle { public int speed() { return 0; } } 12. class Car extends Vehicle { public int speed() { return 60; } } 13. class RaceCar extends Car { public int speed() { return 150; }} ...... 21. RaceCar racer = new RaceCar(); 22. Car car = new RaceCar(); 23. Vehicle vehicle = new RaceCar(); 24. System.out.println(racer.speed() + “, „ + car.speed() 25. + “, “+ vehicle.speed()); What is the result?()
A、 0, 0,0
B、 150, 60, 0
C、 Compilation fails.
D、 150, 150, 150
E、 An exception is thrown at runtime.
- D
关注下方微信公众号,在线模考后查看
热门试题
- Under whatQ
- 已知Strings=“Java”,则下面
- 以下哪种初始化数组的方式是错误的?()&
- What is th
- 下面有关java实例变量,局部变量,类变
- 以下哪些接口是事件侦听器接口?()
- Which retrieve
- 为了不影响程序的正常运行,Javadoc
- 现有: interface
- In a JSP-
- 现有 import&ens
- class super&en
- 以下哪个组件中不能使用HTML标记?()
- Given a
- 已知: 下面哪些代码重载setSize
- 现有: public&en
- 1. public&ensp
- You need
- 基本数据类型float的包裹类是哪项?(
- Math.random()方法用来实现