未分类题

classHorseRadish{2.//insertcodehere3.protectedHorseRadish(intx){4.System.out.println(&qu

A.classHorseRadish{2.//insertcodehere3.protectedHorseRadish(intx){4.System.out.println("bokchoy");5.}6.}7.classWasabiextendsHorseRadish{8.publicstaticvoidmain(String[]args){9.Wasabiw=newWasabi();10.}11.}分别插入到第2行,哪两项允许代码编译并产生"bokchoy"输出结果?()
A.//justacomment
B.protectedHorseRadish(){}
C.protectedHorseRadish(){this(42);}
D.protectedHorseRadish(){newHorseRadish(42);}

【参考答案】

C, D