网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
publicclassPass{publicstaticvoidmain(String[1args){intx5;Passp=newPass();p.doStuff(x);System.out.print(”mainx=+x);}voiddoStuff(intx){System.out.print(”doStuffx=+x++);}}Whatistheresult?()
A.Compilationfails.
B.Anexceptionisthrownatruntime.
C.doStuffx=6mainx=6
D.doStuffx=5mainx=5
E.doStuffx=5mainx=6
F.doStuffx=6mainx=5
参考答案
更多 “ publicclassPass{publicstaticvoidmain(String[1args){intx5;Passp=newPass();p.doStuff(x);System.out.print(”mainx=+x);}voiddoStuff(intx){System.out.print(”doStuffx=+x++);}}Whatistheresult?() A.Compilationfails.B.Anexceptionisthrownatruntime.C.doStuffx=6mainx=6D.doStuffx=5mainx=5E.doStuffx=5mainx=6F.doStuffx=6mainx=5 ” 相关考题
考题
若有如下程序:public class Test {public static void main (String[] args) {int x=20;if (x>10) System.out.print(x-=5);if (x>5) System.out.print(x--);}}则程序运行后的输出结果是【 】。
考题
classPasser{staticfinalintx=5;publicstaticvoidmain(String[]args){newPasser().go(x);System.out.print(x);}voidgo(intx){System.out.print(++x);}}结果是什么?()
A.55B.56C.65D.66
考题
public class Pass{public static void main(String[]args){int x=5;Pass p=new Pass();p.doStuff(x);System.out.print(mainx=+x);}void doStuff(intx){System.out.print(doStuffx=+x++);}}What is the result?()A.Compilation fails.B.An exception is thrown at runtime.C.doStuff x=6 main x=6D.doStuff x=5 main x=5E.doStuff x=5 main x=6F.doStuff x=6 main x=5
考题
Given the command line java Pass2 and:public class Pass2{public void main(String[]args){int x=6;Pass2 p=new Pass2();p.doStuff(x);System.out.print(mainx=+x);}void doStuff(intx){System.out.print(doStuffx=+x++);}}What is the result?()A.Compilation fails.B.An exception is thrown at runtime.C.doStuffx=6 main x=6D.doStuffx=6 mainx =7E.doStuffx=7 mainx =6F.doStuffx=7 mainx =7
考题
public class Test{public static void main(String[]args){intx=5;boolean b1=true;boolean b2=false;if((x==4)!b2)System.out.print(l);System.out.print(2);if((b2=true)b1)System.out.print(3);}}What is the result?()A.2B.3C.12D.23E.123F.Compilation fails.G.An exceptional ist hrown at runtime.
考题
现有:classPasserfstaticfinalintX=5;publicstaticvoidmain(String[]args){newPasser().go(x);System.out.print(x);}voidgo(intx){System.out.print(x++);}结果是什么?()
A.55B.56C.65D.66
考题
publicclassYippee{publicstaticvoidmain(String[]args){for(intx=1;xargs.length;x++){System.out.print(args[x]+);}}}andtwoseparatecommandlineinvocations:javaYippeejavaYippee1234Whatistheresult?()
A.Nooutputisproduced.123B.Nooutputisproduced.234C.Nooutputisproduced.1234D.Anexceptionisthrownatruntime.123E.Anexceptionisthrownatruntime.234F.Anexceptionisthrownatrijntime.1234
考题
GiventhecommandlinejavaPass2and:publicclassPass2{publicvoidmain(String[]args){intx=6;Pass2p=newPass2();p.doStuff(x);System.out.print(”mainx=+x);}voiddoStuff(intx){System.out.print(”doStuffx=+x++);}}Whatistheresult?()A.Compilationfails.B.Anexceptionisthrownatruntime.C.doStuffx=6mainx=6D.doStuffx=6mainx=7E.doStuffx=7mainx=6F.doStuffx=7mainx=7
考题
staticvoidtest(){try{Stringx=null;System.out.print(x.toString()+);}finally{System.out.print(finally);}}publicstaticvoidmain(String[]args){try{test();}catch(Exceptionex){System.out.print(”exception);}}Whatistheresult?()A.nullB.finallyC.nullfinallyD.Compilationfails.E.finallyexception
热门标签
最新试卷