itgle.com

classWrench2{intsize;publicstaticvoidmain(String[]args){Wrench2w=newWrench2();w.size=9;Wrench2w2=go(w,w.size);System.out.print(w2.size);}staticWrench2go(Wrench2wr,ints){s=7;returnwr;}}结果为:()A.7B.9C.编译失败D.输出结果不可预料

题目
classWrench2{intsize;publicstaticvoidmain(String[]args){Wrench2w=newWrench2();w.size=9;Wrench2w2=go(w,w.size);System.out.print(w2.size);}staticWrench2go(Wrench2wr,ints){s=7;returnwr;}}结果为:()

A.7

B.9

C.编译失败

D.输出结果不可预料


相似考题
更多“classWrench2{intsize;publicstaticvoidmain(String[]args){Wrench2w=newWrench2();w.size=9;Wrench2w2=go(w,w.size);System.out.print(w2.size);}staticWrench2go(Wrench2wr,ints){s=7;returnwr;}}结果为:() ”相关问题
  • 第1题:

    classPasser{staticfinalintx=5;publicstaticvoidmain(String[]args){newPasser().go(x);System.out.print(x);}voidgo(intx){System.out.print(++x);}}结果是什么?()

    A.55

    B.56

    C.65

    D.66


    参考答案:C

  • 第2题:

    现有:classWrenchfpublicstaticvoidmain(String[]args){Wrenchw=newWrench();Wrenchw2=newWrench();w2=go(w,w2);System.out.print(w2==w);}staticWrenchgo(Wrenchwrl,Wrenchwr2){Wrenchwr3=wrl;wrl=wr2;wr2=wr3;returnwr3;}结果是什么?()

    A.false

    B.true

    C.编译失败

    D.运行的时候有异常抛出


    参考答案:B

  • 第3题:

    以下代码程序运行后输出结果为 public class Main { public Main() { System.out.print("main "); } public Main(String s) { this(); System.out.print("main with "+s); } public static void main(String[] args) { Main main = new Main("wow"); } }

    A.main with main wow

    B.main main with wow

    C.main main with wow

    D.main with wow main


    87654321

  • 第4题:

    现有:classWrench2{intsize;publicstaticvoidmain(String[]args){Wrench2w=newWrench2();w.size=II;Wrench2w2=go(w,w.size);System.out.print(w2.size);}staticWrench2go(Wrench2wr.ints){S=12;returnwr;}}结果为()

    A.11

    B.12

    C.编译失败

    D.运行时异常被抛出


    参考答案:A

  • 第5题:

    现有:classPasserfstaticfinalintX=5;publicstaticvoidmain(String[]args){newPasser().go(x);System.out.print(x);}voidgo(intx){System.out.print(x++);}结果是什么?()

    A.55

    B.56

    C.65

    D.66


    参考答案:A