欢迎来到天天文库
浏览记录
ID:13056817
大小:64.50 KB
页数:0页
时间:2018-07-20
《javascjp认证考试历年真题.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、SCJP考试题310-025LeadingthewayinITtestingandcertificationtools,QUESTIONNO:92Given:1.Stringfoo=“blue”;2.Boolean[]bar=newBoolean[1];3.if(bar[0]){4.foo=“green”;5.}Whatistheresult?A.Foohasthevalueof“”B.Foohasthevalueofnull.C.Foohasthevalueof“blue”D.Foohasthevalueof
2、“green”E.Anexceptionisthrown.F.Thecodewillnotcompile.Answer:FQUESTIONNO:93Exhibit:1.publicclassX{2.publicstaticvoidmain(String[]args){3.Strings1=newString(“true”);4.Booleanb1=newBoolean(true);5.if(s2.equals(b1)){6.System.out.printIn(“Equal”);7.}8.}9.}Whatist
3、heresult?A.Theprogramrunsandprintsnothing.B.Theprogramrunsandprints“Equal”C.Anerroratline5causescompilationtofail.D.Theprogramrunsbutabortswithanexception.Answer:AQUESTIONNO:94Given:1.publicclassFoo{2.publicstaticvoidmain(String[]args){3.inti=1;4.intj=i++;5.
4、if((i>++j)&&(i++==j)){6.i+=j;7.}8.}9.}Whatisthefinalvalueofi?A.1B.2C.3D.4E.5Answer:BQUESTIONNO:95Exhibit:1.publicclassX{2.publicstaticvoidmain(String[]args){3.strings=newstring(“Hello”);4.modify(s);5.System.out.printIn(s);6.}7.8.publicstaticvoidmodify(String
5、s){9.s+=“world!”;10.}11.}Whatistheresult?E.Theprogramrunsandprints“Hello”F.Anerrorcausescompilationtofail.G.Theprogramrunsandprints“Helloworld!”H.Theprogramrunsbutabortswithanexception.Answer:AQUESTIONNO:96Whichtwoareequivalent?(ChooseTwo)A.16>4B.16/2C.16*4D
6、.16>>2E.16/2^2F.16>>>2Answer:D,FQUESTIONNO:97Exhibit:1.publicclassX{2.publicstaticvoidmain(String[]args){3.int[]a=newint[1]4.modify(a);5.System.out.printIn(a[0]);6.}7.8.publicstaticvoidmodify(int[]a){9.a[0]++;10.}11.}Whatistheresult?A.Theprogramrunsandprints
7、“0”B.Theprogramrunsandprints“1”C.Theprogramrunsbutabortswithanexception.D.Anerror“possibleundefinedvariable”atline4causescompilationtofail.E.Anerror“possibleundefinedvariable”atline9causescompilationtofail.QUESTIONNO:98Given:13.publicclassFoo{14.publicstatic
8、voidmain(String[]args){15.StringBuffera=newStringBuffer(“A”);16.StringBufferb=newStringBuffer(“B”);17.operate(a,b);18.system.out.printIn{a+“,”+b};19.)20.staticvoidoperate(StringBufferx,StringBuf
此文档下载收益归作者所有