您好,欢迎访问三七文档
310-035SunCertifiedProgrammerforJava2Platform1.4Version9.0310-035LeadingthewayinITtestingandcertificationtools,=724LatestVersionWeareconstantlyreviewingourproducts.Newmaterialisaddedandoldmaterialisrevised.Freeupdatesareavailablefor90daysafterthepurchase.YoushouldcheckyourmemberzoneatTestKinganupdate3-4daysbeforethescheduledexamdate.Hereistheproceduretogetthelatestversion:1.Goto@testking.com.Youshouldstate:Examnumberandversion,questionnumber,andloginID.Ourexpertswillansweryourmailpromptly.CopyrightEachpdffilecontainsauniqueserialnumberassociatedwithyourparticularnameandcontactinformationforsecuritypurposes.Soifwefindoutthataparticularpdffileisbeingdistributedbyyou,TestKingreservestherighttotakelegalactionagainstyouaccordingtotheInternationalCopyrightLaws.310-035LeadingthewayinITtestingandcertificationtools,:107,108,110,112,113,115,129Sendanswerstofeedback@testking.com.QUESTIONNO: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,B310-035LeadingthewayinITtestingandcertificationtools,:11.inti=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:E310-035LeadingthewayinITtestingandcertificationtools,:1.interfaceAnimal{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:9310-035LeadingthewayinITtestingandcertificationtools,:AQUESTIONNO:
本文标题:SCJP试题
链接地址:https://www.777doc.com/doc-5517743 .html