电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

太阳证明了Java2平台的1.4Ver程序员VIP免费

太阳证明了Java2平台的1.4Ver程序员_第1页
太阳证明了Java2平台的1.4Ver程序员_第2页
太阳证明了Java2平台的1.4Ver程序员_第3页
Exam:310-035Title:SunCertifiedProgrammerforJava2Platform1.4Ver:04.21.04Note:SectionAcontains147questions.SectionBcontains147questions.Thetotalnumberofquestionsis294.SectionAQUESTION1Given:1publicclassTest{2publicstaticvoidmain(Stringargs[]){3classFoo{4publicinti=3;5}6Objecto=(Object)newFoo();7Foofoo=(Foo)o;8System.out.println("i="+foo.i);9}10}Whatistheresult?A.i=3B.Compilationfails.C.AClassCastExceptionisthrownatline6.D.AClassCastExceptionisthrownatline7.Answer:AQUESTION2Whichtwocauseacompilererror?(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.QUESTION3Given:1inti=1,j=10;2do{3if(i++>--j){4continue;5}6}while(i<5);7System.out.println("i="+i+"andj="+j);Whatistheresult?A.i=6andj=5B.i=5andj=5C.i=6andj=5D.i=5andj=6E.i=6andj=6Answer:DQUESTION4Given:1classTest{2privateDemod;3voidstart(){4d=newDemo();5this.takeDemo(d);6}78voidtakeDemo(Demodemo){9demo=null;10demo=newDemo();11}12}WhenistheDemoobject,createdonline3,eligibleforgarbagecollection?A.Afterline5.B.Afterline9.C.Afterthestart()methodcompletes.D.WhenthetakeDemo()methodcompletes.E.Whentheinstancerunningthiscodeismadeeligibleforgarbagecollection.Answer:EQUESTION5Given:1interfaceAnimal{2voidsoundOff();3}45classElephantimplementsAnimal{6publicvoidsoundOff(){7System.out.println("Trumpet");8}9}1011classLionimplementsAnimal{12publicvoidsoundOff(){13System.out.println("Roar");14}15}1617classAlpha1{18staticAnimalget(Stringchoice){19if(choice.equalsIgnoreCase("meateater")){20returnnewLion();21}else{22returnnewElephant();23}24}25}Whichcompiles?A.newAnimal().soundOff();B.Elephante=newAlpha1();C.Lion1=Alpha.get("meateater");D.newAlpha1().get("veggie").soundOff();Answer:DQUESTION6Whichstatementistrue?A.MemoryisreclaimedbycallingRuntime.gc().B.Objectsarenotcollectediftheyareaccessiblefromlivethreads.C.Objectsthathavefinalize()methodsarenevergarbagecollected.D.Objectsthathavefinalize()methodsalwayshavetheirfinalize()methodscalledbeforetheprogramends.E.AnOutOfMemoryerrorisonlythrownifasingleblockofmemorycannotbefoundthatislargeenoughforaparticularrequirement.Answer:BQUESTION7Given:1classA{2A(){}3}45classBextendsA{6}Whichtwostatementsaretrue?(Choosetwo)A.ClassB'sconstructorispublic.B.ClassB'sconstructorhasnoarguments.C.ClassB'sconstructorincludesacalltothis().D.ClassB'sconstructorincludesacalltosuper().Answer:B,DQUESTION8Given:1inti=1,j=10;2do{3if(i>j){4break;5}6j--;7}while(++i<5);8System.out.println("i="+i+"andj="+j);Whatistheresult?A.i=6andj=5B.i=5andj=5C.i=6andj=4D.i=5andj=6E.i=6andj=6Answer:DQUESTION9Whichstatementistrue?A.Assertionscanbeenabledordisabledonaclass-by-classbasis.B.Conditionalcompilationisusedtoallowtestedclassestorunatfullspeed.C.Assertionsareappropriateforcheckingthevalidityofargumentsinamethod.D.Theprogrammercanchoosetoexecuteareturnstatementortothrowanexceptionifanassertionfails.Answer:AQUESTION10Youwantaclasstohaveaccesstomembersofanotherclassinthesamepackage.Whichisthemostrestrictiveaccessthataccomplishesthisobjective?A.publicB.privateC.protectedD.transientE.defaultaccessAnswer:EQUESTION11Given:1intx=3;2inty=1;3if(x=y){4System.out.println("x="+x);5}Whatistheresult?A.x=1B.x=3C.Compilationfails.D.Thecoderunsw...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

精华资料店+ 关注
实名认证
内容提供者

大量教育教学资料

最新文章

确认删除?
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部