欢迎来到易学考试网 易学考试官网
全部科目 > 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.编译错误

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题