18.A.sayB.talkC.speakD.tell

18.

A.say

B.talk

C.speak

D.tell


相关考题:

classBird{staticvoidtalk(){System.out.print(chirp);}}classParrotextendsBird{staticvoidtalk(){System.out.print(hello);}publicstaticvoidmain(String[]args){Bird[]birds={newBird(),newParrot()};for(Birdb:birds)b.talk();}}结果为:()A.chirpchirpB.chirphelloC.hellohelloD.编译失败

现有: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.chirpchirpB.hellohelloC.chirphelloD.编译错误

现有:  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 chirpB、 hello helloC、 chirp helloD、编译错误

单选题class Bird {  static void talk() { System.out.print("chirp "); }  }  class Parrot extends Bird {  static void talk() { System.out.print("hello "); }  public static void main(String [] args) {  Bird [] birds = {new Bird(), new Parrot()};  for( Bird b : birds)  b.talk();  }  }  结果为:()Achirp chirpBchirp helloChello helloD编译失败

单选题现有:  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 chirpB hello helloC chirp helloD编译错误