classSuperFoo{2.SuperFoodoStuff(intx){3.returnnewSuperFoo();4.}5.}6.7.classFooextendsSuperFoo{8.//insertcodehere9.}下面哪三项分别插入到第8行,可以编译?()A.intdoStuff(){return42;}B.intdoStuff(intx){return42;}C.FoodoStuff(intx){returnnewFoo();}D.SuperFoodoStuff(intx){return

题目
classSuperFoo{2.SuperFoodoStuff(intx){3.returnnewSuperFoo();4.}5.}6.7.classFooextendsSuperFoo{8.//insertcodehere9.}下面哪三项分别插入到第8行,可以编译?()

A.intdoStuff(){return42;}

B.intdoStuff(intx){return42;}

C.FoodoStuff(intx){returnnewFoo();}

D.SuperFoodoStuff(intx){returnnewFoo();}


相似考题
更多“classSuperFoo{2.SuperFoodoStuff(intx){3.returnnewSuperFoo();4.}5.}6.7.classFooextendsSuperFoo{8.//insertcodehere9.}下面哪三项分别插入到第8行,可以编译?() ”相关问题
  • 第1题:

    classSynapse{2.protectedintgap(){return7;}3.}4.5.classCrebextendsSynapse{6.//insertcodehere7.}分别插入到第6行,哪三行可以编译?()

    A.intgap(){return7;}

    B.publicintgap(){return7;}

    C.privateintgap(intx){return7;}

    D.protectedCrebgap(){returnthis;}

    E.publicintgap(){returnInteger.getInteger("42");}


    参考答案:B, C, E

  • 第2题:

    现有1.classCalc{2.publicstaticvoidmain(String[]args){3.try{4.intx=Integer.parselnt("42a");5.//insertcodehere6.System.out.print("oops");7.}8.}9.}下面哪两行分别插入到第五行,会导致输"oops"?()

    A.}catch(IllegalArgumentExceptione){

    B.}catch(IllegalStateExceptionc){

    C.}catch(NumbelFormatExceptionn){

    D.}catch(ClassCastExceptionc){


    参考答案:A, C

  • 第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行,有几个可以通过编泽?()


    参考答案:D

  • 第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);}


    参考答案:C, D

  • 第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);}


    参考答案:A, D