个笔试题-富基融通科技_第1页
个笔试题-富基融通科技_第2页
个笔试题-富基融通科技_第3页
个笔试题-富基融通科技_第4页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1:WhichstatementaboutlistenerisA.MostcomponentallowmultiplelistenerstobeB.Ifmultiplelistenerbeaddtoasinglecomponent,theeventonlyaffectedonelistener.ponentdon?tallowmultiplelistenerstobeadd.Whatistheresultwhenyoucompileandrunthefollowingcode?publicclassThrowsDemo{staticvoid{System.out.println("InsidethrowMethod.");thrownewIllegalAccessException("demo");}publicstaticvoidmain(String{{}catch(IllegalAccessException{System.out.println("Caught"+}}}Whatistheresultwhenyoucompileandrunthefollowingcode?publicclassThrowsDemo{staticvoid{System.out.println("InsidethrowMethod.");thrownewIllegalAccessException("demo");}publicstaticvoidmain(String{{}catch(IllegalAccessException{System.out.println("Caught"+}}}pilationB.Runtimepilesuccessfully,nothingisD.InsidethrowMethod.followedbycaught:java.lang.IllegalAccessExcption:demo3:Considertheclasshierarchyshownbelow:classFourWheelerimplementsDrivingUtilitiesclassCarextendsFourWheelerclassTruckextendsFourWheelerclassBusextendsFourWheelerclassCraneextendsFourWheelerConsiderthefollowingcodebelow:1.DrivingUtilitiesdu;2.FourWheelerfw;TruckmyTruck=new4.du=5.fw=new6.fw=Whichofthestatementsbelowaretrue?Line4willnotcompilebecauseaninterfacecannotrefertoanThecodewillcompileandThecodewillnotcompilewithoutanexplicitcastatline6,becausegoingdownthehierarchywithoutcastingisnotallowed.Thecodewillcompileifweputanexplicitcastatline6butwillthrowanexceptionpublicvoidcreate()myVect=new4)publicvoidcreate()myVect=new4)Givethefollowingjavapublicclasspublicstaticvoidmain(Stringargs[]){staticintx[]=newint[15];}}Whichstatementiscorrected?Givethefollowingjavapublicclasspublicstaticvoidmain(Stringargs[]){staticintx[]=newint[15];}}WhichstatementisA.Whencompile,someerrorwillB.Whenrun,someerrorwillC.OutputisD.OutputisGivethefollowingjavaclass:publicclassExample{staticintx[]=newpublicstaticvoidmain(Stringargs[]){}}Whichstatementiscorrected?Givethefollowingjavaclass:publicclassExample{staticintx[]=newpublicstaticvoidmain(Stringargs[]){}}WhichstatementisA.Whencompile,someerrorwillB.Whenrun,someerrorwillC.OutputisD.OutputisWhatwillhappenwhenyouattempttocompileandrunthefollowingcode?publicclassStatic{{intx=}staticintpublicstaticvoidmain(String{x--System.out.println(x+y+++x);}publicstaticvoid{y=x+++}}Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?publicclassStatic{{intx=}staticintpublicstaticvoidmain(String{System.out.println(x+y+++x);}publicstaticvoid{y=x+++}}A.prints:B.prints:C.prints:D.prints:9:3个阶段、8个子阶段,以下哪一个是正常的开GiventhefollowingclassclassA{protectedinti;A(inti){}}whichofthefollowingwouldbeavalidinnerclassforthisclass?Selectvalidanswer:GiventhefollowingclassclassA{protectedinti;A(inti){}}whichofthefollowingwouldbeavalidinnerclassforthisclass?Selectvalidanswer:A.classB{B.classBextendsA{C.classBextendsA{B(){System.out.println(“i=”+i);}D.classB{classA{}Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode?(Assumethatthecodeiscompiledandrunwithassertionsenabled)importpublicclass{privateHashMapcctld;public{cctld=newcctld.put("in","cctld.put("uk","United//more //othermethodspublicStringgetCountry(String{//WhatshouldbeinsertedStringcountry=return 22.Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode?(Assumethatthecodeiscompiledandrunwithassertionsenabled)importpublicclass{privateHashMapcctld;{cctld=newcctld.put("in","cctld.put("uk","Unitedcctld.put("au",//more //othermethodspublicStringgetCountry(String{//WhatshouldbeinsertedStringcountry=return 22.assertcountryCode!=assertcountryCode!=null:"Countrycodecannotbenull"assertcctld!=null:"Nocountrycodedataisassertcctld:"NocountrycodedataisThefollowingcodeisentirecontentsofafilecalledExample.java,causespreciselyoneerrorduringcompilation:classSubClassextends}classBaseClass(){Stringstr;publicBaseClass(){publicBaseClass(Strings){publicclassExample{publicvoidSubClasss=newSubClass(“o”);BaseClassb=newBaseClass(“world”);}}WhichlinewouldbecausetheThefollowingcodeisentirecontentsofafilecalledExample.java,causespreciselyoneerrorduringclassSubClassextends}classBaseClass(){Stringstr;publicBaseClass(){publicBaseClass(Strings){publicclasspublicvoidSubClasss=newSubClass(“ BaseClassb=newBaseClass(“world”);}}WhichlinewouldbecausetheD.在运行阶段主要是进行软件14:Whichofthefollowingstatementsarenotlegal?A.longl=B.inti=C.doubled=D.doublet=SelectvalididentifierofJava:Selectvalididentifierof16:Inthefollowingpiecesofcode,whichonewillcompilewithoutanyA.StringBuffersb1="abcd";B.Booleanb=newBoolean("abcd");C.C:byteb=255;D.floatfl=17:Whicharenot 18:常见的stru

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论