classGuy{Stringgreet(){returnhi}}classCowboyextendsGuy{Stringgreet(){returnhowdy”}}classSurferextendsGuy{Stringgreet(){returndudel”}}classGreetings{publicstaticvoidmain(string[]args){Guy[]guy={newGuy(),newCowboy(),newSurfer()};for(Guy0:guys)System.out.print(g.green());}}结果为:
A.运行时异常被输出
B.第7行出现一个错误,编译失败
C.第8行出现一个错误,编译失败
D.hihihi
E.hihawdydoude