欢迎来到天天文库
浏览记录
ID:15323601
大小:41.50 KB
页数:30页
时间:2018-08-02
《scjp认证考试历年真题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、SCJP认证考试历年真题这都是考试原题,有心人可以收集收集,会让你收益匪浅!因为这一套较多,所以我分<1><2><3><4>.....将他罗列出来!310-025LeadingthewayinITtestingandcertificationtools,www.testking.comQuestionNo:1Given:1.publicclasstest(2.publicstaticvoidmain(Stringargs[]){3.inti=0xFFFFFFF1;4.intj=~i;5.6.}7.)Whatisthedecimalv
2、alueofjatline5?A.0B.1C.14D.–15E.Anerroratline3causescompilationtofail.F.Anerroratline4causescompilationtofail.Answer:DQuestionNo:2Given:Integeri=newInteger(42);Long1=newLong(42);Doubled=newDouble(42.0);WhichtwoexpressionsevaluatetoTrue?(ChooseTwo)A.(i==1)B.(i==d)C.(d==
3、1)D.(i.equals(d))E.(d.equals(i))F.(i.equals(42))Answer:D,EQuestionNo:3Exhibit:1.publicclasstest(2.privatestaticintj=0;3.4.privatestaticbooleanmethodB(intk)(5.j+=k;6.returntrue;6.)7.8.publicstaticvoidmethodA(inti){9.booleanb:10.b=i<10
4、methodB(4);11.b=i<10
5、
6、methodB(8);12
7、.)13.14.publicstaticvoidmain(Stringargs[]}(15.methodA(0);16.system.out.printIn(j);17.)18.)Whatistheresult?A.Theprogramprints“0”B.Theprogramprints“4”C.Theprogramprints“8”D.Theprogramprints“12”E.Thecodedoesnotcomplete.Answer:BQuestionNo:4Given1.Publicclasstest(2.Publicst
8、aticvoidmain(Stringargs[])(3.System.out.printIn(6^3);4.)5.)Whatistheoutput?Answer:5QuestionNo:5Given:1.publicclassFoo{2.publicstaticvoidmain(String[]args){3.StringBuffera=newStringBuffer(“A”);4.StringBufferb=newStringBuffer(“B”);5.operate(a,b);6.system.out.printIn{a+“,
9、”+b};7.)8.staticvoidoperate(StringBufferx,StringBuffery){9.x.append{y};10.y=x;11.)12.}Whatistheresult?A.Thecodecompilesandprints“A,B”.B.Thecodecompilesandprints“A,A”.C.Thecodecompilesandprints“B,B”.D.Thecodecompilesandprints“AB,B”.E.Thecodecompilesandprints“AB,AB”.F.Th
10、ecodedoesnotcompilebecause“+”cannotbeoverloadedforStringBuffer.Answer:DQuestionNo:6Exhibit:1.Publicclasstest(2.PublicstaticvoidstringReplace(Stringtext)(3.Text=text.replace(‘j',‘i');4.)5.6.publicstaticvoidbufferReplace(StringBuffertext)(7.text=text.append(“C”)8.)9.10.p
11、ublicstaticvoidmain(Stringargs[]}(11.StringtextString=newString(“java”);12.StringBuffertextBufferString=newStringBuff
此文档下载收益归作者所有