第1页共15页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第1页共15页选择题1:在软件生命周期中,下列哪个说法是不准确的?A.软件生命周期分为计划、开发和运行三个阶段B.在计划阶段要进行问题焉醛和需求分析C.在开发后期要进行编写代码和软件测试D.在运行阶段主要是进行软件维护2:Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode?(Assumethatthecodeiscompiledandrunwithassertionsenabled)1.importjava.util.*;2.3.publicclassAssertTest4.{5.privateHashMapcctld;6.7.publicAssertTest()8.{9.cctld=newHashMap();10.cctld.put("in","India");11.cctld.put("uk","UnitedKingdom");12.cctld.put("au","Australia");13.//morecode...14.}第2页共15页第1页共15页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第2页共15页15.//othermethods....16.publicStringgetCountry(StringcountryCode)17.{18.//Whatshouldbeinsertedhere?19.Stringcountry=(String)cctld.get(countryCode);20.returncountry;21.}22.}Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode?(Assumethatthecodeiscompiledandrunwithassertionsenabled)1.importjava.util.*;2.3.publicclassAssertTest4.{5.privateHashMapcctld;6.7.publicAssertTest()8.{9.cctld=newHashMap();10.cctld.put("in","India");11.cctld.put("uk","UnitedKingdom");12.cctld.put("au","Australia");第3页共15页第2页共15页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第3页共15页13.//morecode...14.}15.//othermethods....16.publicStringgetCountry(StringcountryCode)17.{18.//Whatshouldbeinsertedhere?19.Stringcountry=(String)cctld.get(countryCode);20.returncountry;21.}22.}A.assertcountryCode!=null;B.assertcountryCode!=null:"Countrycodecannotbenull";C.assertcctld!=null:"Nocountrycodedataisavailable";D.assertcctld:"Nocountrycodedataisavailable";3:Givethefollowingcode:publicclassExample{publicstaticvoidmain(Stringargs[]){intl=0;do{System.out.println(“Doingitforlis:”+l);}while(--l>0)System.out.println(“Finish”);}}Whichwellbeoutput:Givethefollowingcode:publicclassExample{publicstaticvoidmain(Stringargs[]){intl=0;第4页共15页第3页共15页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第4页共15页do{System.out.println(“Doingitforlis:”+l);}while(--l>0)System.out.println(“Finish”);}}Whichwellbeoutput:A.Doingitforlis3B.Doingitforlis1C.Doingitforlis2D.Doingitforlis04:Givethisclassoutline:classExample{privateintx;//restofclassbody…}AssumingthatxinvokedbythecodejavaExample,whichstatementcanmadexbedirectlyaccessibleinmain()methodofExample.java?Givethisclassoutline:classExample{privateintx;//restofclassbody…}AssumingthatxinvokedbythecodejavaExample,whichstatementcanmadexbedirectlyaccessibleinmain()methodofExample.java?A.ChangeprivateintxtopublicintxB.changeprivateintxtostaticintxC.ChangeprivateintxtoprotectedintxD.changeprivateintxtofinalintx5:Whichofthefollowingstatementsarenotlegal?A.longl=4990;B.inti=4L;第5页共15页第4页共15页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第5页共15页C.doubled=34.4;D.doublet=0.9F.6:鉴于Java的特点,它最适合的计算环境是A.并行计算环境B.分布式计算环境C.高强度计算环境D.开放式计算环境7:Whatiswrittentothestandardoutputgiventhefollowingstatement:System.out.println(4|7);Selecttherightanswer:A.4B.5C.6D.78:1.publicclassX{2.publicobjectm(){3.objecto=newfloat(3.14F);4.object[]oa=newobject[1];5.oa[0]=o;6.o=null;7.oa[0]=null;8.returno;9.}10.}Whenisthefloatobjectcreatedinline3,eligibleforgarbage...