相关考题

单项选择题 classTest4{publicstaticvoidmain(String[]args){booleanx=true;booleany=false;shortz=42;if((z++==42)&&(y=true))z++;if((x=false)||(++z==45))z++;System.out.println("z="+z);}}结果为:()

单项选择题 classTestApp{publicstaticvoidmain(String[]args){intx=5;switch(x){case1:case2:case3:System.out.println(一季度”);break;case4:case5:case6:System.out.println(二季度”);case7:case8:case9:System.out.println(三季度”);break;ase10:case11:ase12:System.out.println(四季度”);break;default:System.out.println(不是有效的月份”);}}}上述程序运行后的结果是哪项?()A.一季度B.二季度C.三季度D.四季度

单项选择题 InputStream对象的方法read(byte[]buffer,intoffset,intlength)的返回值的含义是哪项?()

单项选择题 1.classOver{2.intdoIt(longx){return3;}3.}4.5.classUnderextendsOver{6.//insertcodehere7.}和四个方法:shortdoIt(inty){return4;}intdoIt(longx,longy){return4;}privateintdoIt(Shorty){return4;}protectedintdoIt(longx){return4;}分别插入到第6行,有几个可以通过编译?()A.2B.3C.4D.0E.1

单项选择题 Youarebuildingawebapplicationthatwillbe&en

单项选择题 Thesl:shoppingListandsl:itemtagsoutputashoppinglisttotheresponseandareusedasfollows:11.<sl:shoppingList>12.<sl:itemname="Bread"/>13.<sl:itemname="Milk"/>14.<sl:itemname="Eggs"/>15.</sl:shoppingList>Thetaghandlerforsl:shoppingListisShoppingListTagandthetaghandlerforsl:itemisItemSimpleTag.ShoppingListTagextendsBodyTagSupportandItemSimpleTagextendsSimpleTagSupport.Whichistrue?()A.ItemSimpleTagcanfindtheenclosinginstanceofShoppingListTagbycallinggetParent()andcastingtheresulttoShoppingListTag.B.ShoppingListTagcanfindthechildinstancesofItemSimpleTagbycallingsuper.getChildren()andcastingeachtoanItemSimpleTag.C.ItisimpossibleforItemSimpleTagandShoppingListTagtofindeachotherinataghierarchybecauseoneisaSimpletagandtheotherisaClassictag.D.ShoppingListTagcanfindthechildinstancesofItemSimpleTagbycallinggetChildren()onthePageContextandcastingeachtoanItemSimpleTag.E.ItemSimpleTagcanfindtheenclosinginstanceofShoppingListTagbycallingfindAncestorWithClass()onthePageContextandcastingtheresulttoShoppingListTag.

单项选择题 1.classA{2.publicbytefileNumber(){3.returnl;4.}5.}6.7.ClassBextendsA{8.publicshortgetNumber(){9.return2;10.}11.12.publicshortgetNumber(){13.Bb=newB();14.System.out.printIn(b.getNumber());15.}16.}Whatistheresult()?A.Compilationsucceedsandlisprinted.B.Compilationsucceedsand2printed.C.Anerroratline8causecompilationtofail.D.Anerroratline14causecomplicationtofail.E.Complicationsucceedsbutanexceptionisthrownatline14.

单项选择题 Oneoftheusecasesinyourwebapplicationusesmanysession-scopedattributes.Attheendoftheusecase,youwanttoclearoutthissetofattributesfromthesessionobject.Assumethatthisstaticvariableholdsthissetofattributenames:201.privatestaticfinalSet<String>USE_CASE_ATTRS;202.static{203.USE_CASE_ATTRS.add("customerOID");204.USE_CASE_ATTRS.add("custMgrBean");205.USE_CASE_ATTRS.add("orderOID");206.USE_CASE_ATTRS.add("orderMgrBean");207.}Whichcodesnippetdeletestheseattributesfromthesessionobject?()A.session.removeAll(USE_CASE_ATTRS);B.for(Stringattr:USE_CASE_ATTRS){session.remove(attr);}C.for(Stringattr:USE_CASE_ATTRS){session.removeAttribute(attr);}D.for(Stringattr:USE_CASE_ATTRS){session.deleteAttribute(attr);}E.session.deleteAllAttributes(USE_CASE_ATTRS);

单项选择题 1.classA{3.publicStringtoString(){4.return4”;5.}6.}7.classBextendsA{8.publicStringtoString(){9.returnsuper.toString()+3”;10.}11.}12.publicclassTest{13.publicstaticvoidmain(String[]args){14.System.out.printIn(newB());15.}16.}Whatistheresult()?A.Compilationsucceedsand4isprinted.B.Compilation……………isprinted.C.Anerroronline9causecompilationtofail.D.Anerroronline14causecompilationtofail.E.Compilationsucceedsbutanexceptionisthrownatline9.

单项选择题 1.classSuperFo{2.SuperFodoStuff(intx){3.returnnewSuperFo()4.}5.}6.7.classFooextendsSuperFo{8.//insertcodehere9.}和四个声明:FoodoStuff(intx){returnnewFoo();}FoodoStuff(intx){returnnewSuperFoo();}SuperFoodoStuff(intx){returnnewfoo();}SuperFoodoStuff(inty){returnnewSuperFoo();}分别插入到第8行,有几个可以通过编译()A.1B.2C.3D.4E.5

单项选择题 类Student中字段mark的缺省值是哪项?()ClassStudent{Stringname;intage;floatmarket;·········}

单项选择题 intx=0step1for(;x<11;x++){if(x==6){x=8breakstep1;}if(x==3){x++continue}System.out.print(x+”);}结果为:()

单项选择题 classAnimal{AnimalgetOne(){returnnewAnimal();}}classDogextendsAnimal{//insertcodehere}classAnimalTest{publicstaticvoidmain(String[]args){Animal[]animal={newAnimal(),newDog()};for(Animala:animal){Animalx=a.getOne();}}}和代码:3a.DoggetOne(){returnnewDog();}3b.AnimalgetOne(){returnnewDog();}第3行中插入的哪项编译且运行无异常?A.3a行或3b行B.既非3a,也非3bC.3a行D.3b行

单项选择题 classOutput{publicstaticvoidmain(String[]args){inti=4;System.out.print("3"+i+"");System.out.print(i+4+"6");System.out.println(i+"7");}}结果为:()

单项选择题 LessTest{publicstaticvoidmain(String[]args){for(intx=0;x<7;++x){inty=2;x=++y;}System.out.println(y=”+y);}}结果为:()

单项选择题 针对Sets接口,下列哪项是正确的?()

单项选择题 WhichimplicitobjectisusedinaJSPpagetoretrievevaluesassociatedwithentriesinthedeploymentdescriptor?()

单项选择题 Totakeadvantageofthecapabilitiesofmodernbrowsersthatusewebstandards,suchasXHTMLandCSS,yourwebapplicationisbeingconvertedfromsimpleJSPpagestoJSPDocumentformat.However,oneofyourJSPs,/scripts/screenFunctions.jsp,generatesaJavaScriptfile.Thisfileisincludedinseveralwebformstocreatescreen-specificvalidationfunctionsandareincludedinthesepageswiththefollowingstatement:10.<head>11.<scriptsrc=‘/scripts/screenFunctions.jsp‘12.language=‘javascript‘13.type=‘application/javascript‘></script>14.</head>15.<!--bodyofthewebform-->WhichJSPcodesnippetdeclaresthatthisJSPDocumentisaJavaScriptfile?()

单项选择题 classThreadExceptimplementsRunnable{publicvoidrun(){thrownewRuntimeException("exception");}publicstaticvoidmain(String[]args){newThread(newThreadExcept()).start();try{intx=Integer.parseInt(args[0]);Thread.sleep(x);System.out.print("main");}catch(Exceptione){}}}和命令行:javaThreadExcept1000哪一个是结果?()A.mainB.编译失败C.代码运行,但没有输出D.mainjava.lang.RuntimeException:exception

单项选择题 现有如下类型:a-java.util.Hashtableb-java.util.Listc-java.util.ArrayListd-java.util.SortedSet和定义:1–使用本接口,允许用户控制集合中每个元素的插入位置。2–使用本集合,确保用户可以按照递增或元素的自然顺序遍历集合。3–本具体类型允许空元素及基于索引的访问。4–本集合是同步的。哪一组匹配是对的?()