试题详情
- 单项选择题 现有: class Bird { void talk() { System.out.print("chirp "); } } class Parrot2 extends Bird { protected void talk() { System.out.print("hello "); public static void main(String [] args) { Bird [] birds = {new Bird(), new Parrot2 () }; for( Bird b : birds) b.talk () ; } } 结果是什么 ?()
A、 chirp chirp
B、 hello hello
C、 chirp hello
D、编译错误
- C
关注下方微信公众号,在线模考后查看
热门试题
- 可以通过继承哪个类来创建线程?()
- interface Data
- What is th
- 已知: 的输出为()
- 请问下列代码的输出结果有可能是哪些()。
- 已知: 那么,在哪种情况下可以访问x(
- What is th
- What is th
- 设计一个汽车类Multiplicatio
- Which pathQ
- 有一对兔子,从出生后第3个月起每个月都生
- 删除File实例所对应文件的方法是?()
- public class&e
- 下面哪些方法禁止子类重定义该方法()
- 现有: cla
- class Test4&en
- public class&
- 一个两位数的正整数,如果将其个位数与十位
- 有哺乳动物类mammal,将其作为父类,
- 编写一个应用程序,对程序中给定的四个do