A.protectedHorseRadish(){this(42);}
B.protectedHorseRadish(){}
C.//justacomment
D.protectedHorseRadish(){newHorseRadish(42);}
第1题
现有:
1.interfaceAnimalf
2.voideat();
3.}
4.
5.//insertcodehere
6.
7.publicclassHouseCatimplementsFeline{
8.publicvoideat(){}
9.}
和以下三个接口声明:
interfaceFelineextendsAnimal()
interfaceFelineextendsAnimal{voideat();}
interfaceFelineextendsAnimal{voideat(){}}
分别插入到第5行,有多少行可以编译?
第2题
现自:
1.interfaceColor{}
2.interfaceWeight{}
3.//insertcodehere
和以下足六个声明:
classBoatextendsColor,extendsWeight{}
classBoatextendsColorandWeight{}
classBoatextendsColor,Weight{}
classBoatimplementsColor,implementsWeight{}
classBoatimplementsColorandWeight{}
classBoatimplementsColor,Weight{}
分别插入到第3行,有多少行可以编译?()
第3题
现有:
1.abstractclassColor{
2.protectedabstractStringgetRGB();
3.}
4.
5.publicclassBlueextendsColor{
6.//insertcodehere
7.}
和四个声明:
publicStringgetRGB(){return"blue";}
StringgetRGB(){return"blue";)
privateStringgetRGB(){return"blue";}
protectedStringgetRGB(){return"blue";)
分别插入到第6行,有几个可以通过编译?()
第4题
现有:1.abstractclassColor2{2.//insertcodehere3.}4.5.publicclassBlue2extendsColor2{6.publicStringgetRGB(){return"blue";}7.}和4个声明:publicabstractStringgetRGB();abstractStringgetRGB();privateabstractStringgetRGB();protectedabstractStringgetRGB();分别插入到第2行,有多少行可以编译?()
A.0
B.1
C.2
D.3
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!