SCJP认证复习题目(含注解)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

说明:TK.Sun.Certified.Programmer.for.Java.2.Platform.1.4(310-035).V12.pdf是我从公众互联网上获得,在认证SCJP的过程中作为自己的参考习题,我不对它的版权负任何责任。在做题的过程中,我对里面的所有题目均做了标注,对大部分题目加了注解,所有程序代码均上机做了验证(eclipse3.0+jdk-1_5_0_06-windows-i586-p)。今天,我把我做的“注解”发布到互联网上,希望对大家复习SCJP1.4认证考试有所帮助。请大家尊重我个人的一点点劳动,你可以传播它,但不要私自更改或利用它做商业用途。最后,由于自己水平实在有限,错误之处在所难免,如有你发现了问题,还请批评指正,谢谢!Tommy(小可)E-Mail:busily@msn.com,busily@gmail.comQQ:2841421310-035SunCertifiedProgrammerforJava2Platform1.4Version12.0310-035LeadingthewayinITtestingandcertificationtools,=724LatestVersionWeareconstantlyreviewingourproducts.Newmaterialisaddedandoldmaterialisrevised.Freeupdatesareavailablefor90daysafterthepurchase.YoushouldcheckyourmemberzoneatTestKinganupdate3-4daysbeforethescheduledexamdate.Hereistheproceduretogetthelatestversion:1.Goto@testking.com.Youshouldstate:Examnumberandversion,questionnumber,andloginID.Ourexpertswillansweryourmailpromptly.CopyrightEachpdffilecontainsauniqueserialnumberassociatedwithyourparticularnameandcontactinformationforsecuritypurposes.Soifwefindoutthataparticularpdffileisbeingdistributedbyyou,TestKingreservestherighttotakelegalactionagainstyouaccordingtotheInternationalCopyrightLaws.310-035LeadingthewayinITtestingandcertificationtools,:1Given:1.publicclassTest{2.publicstaticvoidmain(Stringargs[]){3.classFoo{4.publicinti=3;5.}6.Objecto=(Object)newFoo();7.Foofoo=(Foo)o;8.System.out.println(“i=“+foo.i);9.}10.}Whatistheresult?A.i=3B.Compilationfails.C.AClassCastExceptionisthrownatline6.D.AClassCastExceptionisthrownatline7.Answer:AQUESTIONNO:2Whichtwocauseacompilererror?(Choosetwo)A.float[]=newfloat(3);B.floatf2[]=newfloat[];C.float[]f1=newfloat[3];D.floatf3[]=newfloat[3];E.floatf5[]={1.0f,2.0f,2.0f};F.floatf4[]=newfloat[]{1.0f.2.0f.3.0f};Answer:A,BTheF.statementisincorrect.Thefloatnumbersshouldbeseparatedwithcommasandnotdots.QUESTIONNO:3310-035LeadingthewayinITtestingandcertificationtools,=1,j=10;12.do{13.if(i++--j){14.continue;15.}16.}while(i5);17.System.out.println(“i=“+i+“andj=“+j);Whatistheresult?A.i=6andj=5B.i=5andj=5C.i=6andj=5D.i=5andj=6E.i=6andj=6Answer:DQUESTIONNO:4Given:1.classTest{2.privateDemod;3.voidstart(){4.d=newDemo();5.this.takeDemo(d);6.}7.8.voidtakeDemo(Demodemo){9.demo=null;10.demo=newDemo();11.}12.}WhenistheDemoobject,createdonline3,eligibleforgarbagecollection?A.Afterline5.B.Afterline9.C.Afterthestart()methodcompletes.D.WhenthetakeDemo()methodcompletes.E.Whentheinstancerunningthiscodeismadeeligibleforgarbagecollection.Answer:EQUESTIONNO:5310-035LeadingthewayinITtestingandcertificationtools,{2.voidsoundOff();3.}4.5.classElephantimplementsAnimal{6.publicvoidsoundOff(){7.System.out.println(“Trumpet”);8.}9.}10.11.classLionimplementsAnimal{12.publicvoidsoundOff(){13.System.out.println(“Roar”);14.}15.}16.17.classAlpha1{18.staticAnimalget(Stringchoice){19.if(choice.equalsIgnoreCase(“meateater”)){20.returnnewLion();21.}else{22.returnnewElephant();23.}24.}25.}Whichcompiles?A.newAnimal().soundOff();B.Elephante=newAlpha1();C.Lion1=Alpha.get(“meateater”);D.newAlpha1().get(“veggie”).soundOff();Answer:DQUESTIONNO:6Whichstatementistrue?A.MemoryisreclaimedbycallingRuntime.gc().B.Objectsarenotcollectediftheyareaccessiblefromlivethreads.C.Objectsthathavefinalize()methodsarenevergarbagecollected.D.Objectsthathavefinalize()methodsalwayshavetheirfinalize()methodscalledbeforetheprogramends.E.AnOutOfMemoryerrorisonlythrownifasingleblockofmemorycannotbefoundthatislargeenoughforaparticularrequirement.310-035LeadingthewayinITtestingandcertificationtools,:7Given:1.classA{2.A(){}3.}4.5.classBextendsA{6.}Whichtwostatementsaretrue?(Choosetwo)A.ClassB’sconstructorispublic.B.ClassB’sconstructorhasnoarguments.C.ClassB’sconstructorincludesacalltothis().D.ClassB’sconstructorincludesacalltosuper().Answer:B,DQUESTIONNO:8Given:11.inti=1,j=10;12.do{13.if(ij){14.break;15.}16.j--;17.}while(++i5);18.System.out.println(“i=”+i+”andj=“+j);Whatistheresult?A.i=6andj=5B.i=5andj=5C.i=6andj=4D.i=5andj=6E.i=6andj=6Answer:DQUESTIONNO:9Whichstatementistrue?310-035LeadingthewayinITtestingandcertification

1 / 143
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功