A.intdoStuff(){return42;}
B.intdoStuff(intx){return42;}
C.FoodoStuff(intx){returnnewFoo();}
D.SuperFoodoStuff(intx){returnnewFoo();}
第1题:
A.intgap(){return7;}
B.publicintgap(){return7;}
C.privateintgap(intx){return7;}
D.protectedCrebgap(){returnthis;}
E.publicintgap(){returnInteger.getInteger("42");}
第2题:
A.}catch(IllegalArgumentExceptione){
B.}catch(IllegalStateExceptionc){
C.}catch(NumbelFormatExceptionn){
D.}catch(ClassCastExceptionc){
第3题:
现有:
1.classSuperFoo{
2.SuperFoodoStuff(intx){
3.returnnewSuperFoo();
4.}
5.}
6.
7.classFooextendsSuperFoo{
8.//insertcodehere
9.}
和四个声明:
FoodoStuff(intx){returnnewFoo();}
FoodoStuff(intx){returnnewSuperFoo();}
SuperFoodoStuff(intx){returnnewFoo();}
SuperFoodoStuff(inty){returnnewSuperFoo();}
分别插入到第8行,有几个可以通过编泽?()
第4题:
现有:1.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);}
第5题:
现有:classHorseRadish{//insertcodehereprotectedHorseRadish(intx){System.out.println("bokchoy");}}classWasabiextendsHorseRadish{publicstaticvoidmain(String[]args){Wasabiw-newWasabi();}}分别插入到第2行,哪两项允许代码编译并产生”bokchoy”输出结果()
A.protectedHorseRadish(){this(42);}
B.protectedHorseRadish(){}
C.//justacomment
D.protectedHorseRadish(){newHorseRadish(42);}