欢迎来到天天文库
浏览记录
ID:13420966
大小:64.50 KB
页数:0页
时间:2018-07-22
《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.Anexceptionisth
2、rown.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.}Whatistheresult?A.Theprogramrunsandprintsnothing.B.Thep
3、rogramrunsandprints“Equal”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.
4、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(Strings){9.s+=“world!”;10.}11.}Whatistheresult?E.Theprogramrunsandprints“Hello”F.Anerrorcausescompilat
5、iontofail.G.Theprogramrunsandprints“Helloworld!”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
6、[1]4.modify(a);5.System.out.printIn(a[0]);6.}7.8.publicstaticvoidmodify(int[]a){9.a[0]++;10.}11.}Whatistheresult?A.Theprogramrunsandprints“0”B.Theprogramrunsandprints“1”C.Theprogramrunsbutabortswithanexception.D.Anerror“possibleundefinedvariable”atline4causescompilationtofail.E.Ane
7、rror“possibleundefinedvariable”atline9causescompilationtofail.QUESTIONNO: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.staticvoidopera
8、te(StringBufferx,StringBuf
此文档下载收益归作者所有