可学答题网 > 问答 > Java认证考试综合练习题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

现有:  class Bird {&ensp


现有:  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编译错误
参考答案
参考解析:
分类:Java认证考试综合练习题库
相关推荐

1、现有:  class Foo  {

现有: class Foo  { public static void main (String  []  args)  {   &ensp...

2、现有:     class&ens

现有:    class TestApp{ public  static  void main (String[]  args){    &...

3、现有:  class Cat { 

现有: class Cat { Cat(int c) { System.out.print("cat" + c + " "); } } class Sub...

4、现有   1. class Cal

现有  1. class Calc { 2.  public static void main(String [] args) {  3.  ...

5、现有:  class Flow {&ensp

现有: class Flow { public static void main(String [] args)  try { System. out .print&en...

6、现有:     class&ens

现有:    class Pencil  { public void write (String content){     System.out.p...