单项选择题

A.<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–本集合是同步的。哪一组匹配是对的?()

单项选择题 现有:3.importjava.util.*;4.classForInTest{5.staticListlist=newArrayList();6.publicstaticvoidmain(String[]args){7.8.list.add("a");list.add("b");list.add("c");9.//insertcodehere10.System.out.print(o);}}哪一行插入到第9行将导致输出abc”?()A.for(Objecto:list)B.for(Iteratoro:list)C.for(Objecto:list.iterator())D.for(Iteratoro:list.iterator();o.hasNext();)

单项选择题 SqueakyBeansInc.hiredanoutsideconsultanttodeveloptheirwebapplication.Tofinishthejobquickly,theconsultantcreatedseveraldozenJSPpagesthatdirectlycommunicatewiththedatabase.TheSqueakybusinessteamhassincepurchasedasetofbusinessobjectstomodeltheirsystem,andtheSqueaky developerchargedwithmaintainingthewebapplicationmustnowrefactoralltheJSPstoworkwiththenewsystem.Whichpatterncanthedeveloperusetosolvethisproblem?()A.TransferObjectB.ServiceLocatorC.InterceptingFilterD.BusinessDelegate

单项选择题 Adeveloperisdesigningawebapplicationthatmustverifyforeachrequest:Theoriginatingrequestisfromatrustednetwork.Theclienthasavalidsession.Theclienthasbeenauthenticated.Whichdesignpatternprovidesasolutioninthissituation?()A.TransferObjectB.SessionFacadeC.InterceptingFilterD.TemplateMethodE.Model-View-Controller

单项选择题 YouarecreatingawebformwiththisHTML:11.<formaction="sendOrder.jsp">12.<inputtype="text"name="creditCard">13.<inputtype="text"name="expirationDate">14.<inputtype="submit">15.</form>WhichHTTPmethodisusedwhensendingthisrequestfromthebrowser?()A.GETB.PUTC.POSTD.SENDE.FORM

单项选择题 GivenanHttpSessionsession,aServletRequestrequest,andaServletContextcontext,whichretrievesaURLto/WEB-INF/myconfig.xmlwithinawebapplication?()

单项选择题 TheSqueakyBeancompanyhasdecidedtoporttheirwebapplicationtoanewJ2EE1.4container.Whilereviewingtheapplication,adeveloperrealizesthatinmultipleplaceswithinthecurrentapplication,nearlyduplicatecodeexiststhatfindsenterprisebeans.Whichpatternshouldbeusedtoeliminatethisduplicatecode?()A.TransferObjectB.FrontControllerC.ServiceLocatorD.InterceptingFilterE.BusinessDelegateF.Model-View-Controller