欢迎来到天天文库
浏览记录
ID:18187286
大小:64.50 KB
页数:43页
时间:2018-09-15
《javascjp认证考试历年真题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
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“green”E.Anexceptionisthrown.F.Theco
2、dewillnotcompile.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.}Whatistheresult?A.Theprogramrunsandprintsnothing.B.Theprogramrunsandprints“Equa
3、l”C.Anerroratline5causescompilationtofail.D.Theprogramrunsbutabortswithanexception.Answer:AQUESTIONNO:94Given:1.publicclassFoo{2.publicstaticvoidmain(String[]args){3.inti=1;4.intj=i++;5.if((i>++j)&&(i++==j)){6.i+=j;7.}8.}9.}Whatisthefinalvalueofi?A.1B.2C.3D.4E.5Answer:BQUESTIONNO:95Exhibit:1.p
4、ublicclassX{2.publicstaticvoidmain(String[]args){3.strings=newstring(“Hello”);4.modify(s);5.System.out.printIn(s);6.}7.8.publicstaticvoidmodify(Strings){9.s+=“world!”;10.}11.}Whatistheresult?E.Theprogramrunsandprints“Hello”F.Anerrorcausescompilationtofail.G.Theprogramrunsandprints“Helloworld!”
5、H.Theprogramrunsbutabortswithanexception.Answer:AQUESTIONNO:96Whichtwoareequivalent?(ChooseTwo)A.16>4B.16/2C.16*4D.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.publicstati
6、cvoidmodify(int[]a){9.a[0]++;10.}11.}Whatistheresult?A.Theprogramrunsandprints“0”B.Theprogramrunsandprints“1”C.Theprogramrunsbutabortswithanexception.D.Anerror“possibleundefinedvariable”atline4causescompilationtofail.E.Anerror“possibleundefinedvariable”atline9causescompilationtofail.QUESTIONNO
7、:98Given:13.publicclassFoo{14.publicstaticvoidmain(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
此文档下载收益归作者所有