现有:classBird{voidtalk(){System.out.print("chirp");}}classParrot2extendsBird{protectedvoidtalk(){System.out.print("hello");publicstaticvoidmain(String[]args){Bird[]birds={newBird(),newParrot2()};for(Birdb:birds)b.talk();}}结果是什么?()

A.chirpchirp B.hellohello C.chirphello D.编译错误

时间:2023-08-25 23:23:21

相似题目