欢迎来到天天文库
浏览记录
ID:13856472
大小:41.50 KB
页数:30页
时间:2018-07-24
《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.)Whatisthedecimalvalueofjatline5?
2、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==1)D.(i.equals(d))E.(d.equals(i
3、))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.)13.14.publicstaticvoidmain(Stringargs[]}(15
7、.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.Publicstaticvoidmain(Stringargs[])(3.System.out.printIn(6^3);4.)5.)W
8、hatistheoutput?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+“,”+b};7.)8.staticvoidoperate(StringBufferx,StringBuffery){9.x.append{y};10.y
9、=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.Thecodedoesnotcompilebecause“+”cannotbeoverloadedforStringBuffer.Answer:DQuestionNo:6Exhibit
10、:1.Publicclasstest(2.PublicstaticvoidstringReplace(Stringtext)(3.Text=text.replace(‘j',‘i');4.)5.6.publicstaticvoidbufferReplace(StringBuffertext)(7.text=text.append(“C”)8.)9.10.publicstaticvoidmain(Stringargs[]}(11.StringtextString=newString(“java”);12.StringBuffertextBufferString=n
11、ewStringBuff
此文档下载收益归作者所有