多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

现有:  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
答案解析:
进入题库查看解析

微信扫一扫手机做题