现有: class HorseRadish { //insert code here protected HorseRadish (int x) { System.out.println ("bok choy"); } } class Wasabi extends HorseRadish { public static void main (String [] args){ Wasabi w- new Wasabi(); } } 分别插入到第2行,哪两项允许代码编译并产生”bok choy”输出结果()
- A、 protected HorseRadish() {this (42);}
- B、 protected HorseRadish() {}
- C、 //just a comment
- D、 protected HorseRadish() { new HorseRadish (42);}
正确答案:A,D
答案解析:有
微信扫一扫手机做题