个的笔试题阿里巴巴网络技术_第1页
个的笔试题阿里巴巴网络技术_第2页
个的笔试题阿里巴巴网络技术_第3页
个的笔试题阿里巴巴网络技术_第4页
个的笔试题阿里巴巴网络技术_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

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

文档简介

1.1.Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?3.i=9.publicvoidamethod()}}27.publicclassDerivedextendsBi=-1;35.publicstaticvoidmain(Stringargv[])Baseb=newWhichWhichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode?(Assumethatthecodeiscompiledandrunwithassertionsenabled)5.1.import7.9.3.publicclass11.4.}publicvoid}Derived.amethod()Derived.amethod()-1Derived.amethod()99piletimeerrorprivateHashMappublic{cctld=newcctld.put("uk","United//more}33.15. //othermethods35.16. publicStringgetCountry(StringcountryCode) 39.18. //Whatshouldbeinsertedhere?41.19. Stringcountry=(String)cctld.get(countryCode); return 47.22.assertassertcountryCode!=assertcountryCode!=null:"Countrycodecannotbenull"assertcctld!=null:"Nocountrycodedataisassertcctld:"NocountrycodedataisWhatwillbetheresultofexecutingthefollowingbooleana=booleanb=booleanc=if(a==true)if(b==if(c== System.out.println("SomethingsaretrueinthisSystem.out.println("Nothingistrueinthiselseif(a&&(b=c))System.out.println("It'stooconfusingatislwhatistrueand10.elseSystem.out.println("Heythiswon'tcompile"); A.Thecodewon'tB."Somethingsaretrueinthisworld"willbeC."Heythiswon'tcompile"willbeD.Noneof4:Aclassdesignrequiresthatamembervariableshouldbeaccessibleonlybysamepackage,whichmodiferwordshouldbeused?C.nomodifer5:Whichisthemain()methodreturnofaGivenGiventhefollowingclassclassprotectedintA(int}}whichofthefollowingwouldbeavalidinnerclassforthisSelectvalidclassclassB{classBextendsA{classBextendsA{B(){System.out.println(“i=”+i);}classB{classA{}1.Strings=”ExampleString”;Whichoperationisnot D.importD.importjava.io.*;importjava.awt.*;publicclassTest{//do10:Whichofthefollowingstatementsare{//dosomething...}publicclassTest{//doC.importjava.io.*;A.inti=s.length();C.StringD.String9:WhichfragmentsarenotcorrectinJavasourceA.packagetestpackage;publicclassTest{//doB.importjava.io.*;packagetestpackage;publicclassTest{//doeseseligibleforgarbagecollectionwhenallreferencesdenotingitD.AnsettoC.Garbagecollection tformB.AprogramcansuggestthatgarbagecollectionbeperformedA.TheautomaticgarbagecollectionoftheJVMpreventsprogramsfromeverrunningof1.1.Whatresultsfromattemptingtocompileandrunthefollowingcode?3.publicclassTernary5.7.publicstaticvoidmain(Stringargs[])9.11.inta=5;13.System.out.println("Valueis-"+((a<5)?9.9:9));A.prints:A.prints:Valueis-pilationC.prints:Valueis-D.NoneofGivethefollowingjavasource//pointpublicclass//do//do}WhichstatementiscorrectlyJavasyntaxatpointpublicpublicclassMyClass{//dootherstaticintclassMyClass{//dosomething…}1.Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?3.(Assumethatthecodeiscompiledandrunwithassertionsenabled.)5.publicclassAssertTest{7.publicvoidmethodA(inti){9.asserti>=0:methodB();15.publicvoidmethodB(){17.System.out.println("Thevaluemustnotbenegative");21.publicstaticvoidmain(Stringargs[]){23.AssertTesttest=newAssertTest();ititwillprint-itwillresultinAssertionErrorshowingthemessage-“thevaluemustnotbethecodewillnotNoneofGiveGivethecodeelseifelseWhichrangeofvaluexwouldproduceofoutput“Test 下(不能用C/C++中的函数或类) 20:C/C++源代码中,检查花括弧“(”“)”,“{”与“}”)是否匹配,若不匹配,则输出不匹配花21:Java程序,程序中要进行数组操作和除法操作,要求对所设计的程序可能出现22:Hashtabl

温馨提示

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

评论

0/150

提交评论