网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
GiventheHttpServletcode:getServletContext().setAttribute(“foo”,“value”);Whatistheresult?()

A.Theattributefooisplacedintheapplication

B.AServletContextListenerregisteredforthatservletisnotified

C.AServletAttributeListenerregisteredforthatservletisnotified

D.AnHttpSessionAttributeListenerregisteredforthatservletisnotified


参考答案

更多 “ GiventheHttpServletcode:getServletContext().setAttribute(“foo”,“value”);Whatistheresult?() A.TheattributefooisplacedintheapplicationB.AServletContextListenerregisteredforthatservletisnotifiedC.AServletAttributeListenerregisteredforthatservletisnotifiedD.AnHttpSessionAttributeListenerregisteredforthatservletisnotified ” 相关考题
考题 Given:Stringvalue=getServletContext().getInitParameter(foo);inanHttpServletandawebapplicationdeploymentdescriptorthatcontains:context-paramparam-namefoo/param-nameparam-valuefrodo/param-value/context-paramWhichtwoaretrue?()A.ThefooinitializationparameterCANNOTbesetprogrammatically.B.CompilationfailsbecausegetInitParameterreturnstypeObject.C.ThefooinitializationparameterisNOTaservletinitializationparameter.D.CompilationfailsbecauseServletContextdoesNOThaveagetInitParametermethod.E.Thefooparametermustbedefinedwithintheelementofthedeploymentdescriptor.

考题 ClicktheExhibitbutton.Given:11.%com.example.Advisoradvisor=newcom.example.Advisor();%12.%request.setAttribute(foo,advisor);%Assumingtherearenootherfooattributesinthewebapplication,whichthreearevalidELexpressionsforretrievingtheadvicepropertyofadvisor?()A.${foo.advice}B.${request.foo.advice}C.${requestScope.foo.advice}D.${requestScope[foo[advice]]}E.${requestScope[foo][advice]}

考题 Given:6.%int[]nums={42,420,4200};7.request.setAttribute(foo,nums);%Whichtwosuccessfullytranslateandresultinavalueoftrue?() A.${trueorfalse}B.${requestScope[foo][0]500}C.${requestScope[’foo’][1]=420}D.${(requestScope[’foo’][0]lt50)(3gt2)}

考题 Given:1.%int[]nums={42,420,4200};2.request.setAttribute(foo,nums);%3.${5+3lt6}4.${requestScope[’foo’][0]ne10div0}5.${10div0}Whatistheresult?() A.TruetrueB.FalsetrueC.Falsetrue0D.TruetrueInfinityE.FalsetrueInfinity

考题 GiventheJSPcode:%request.setAttribute(foo,bar);%andtheClassictaghandlercode:5.publicintdoStartTag()throwsJspException{6.//insertcodehere7.//returnint8.}Assumetherearenootherfooattributesinthewebapplication.WhichinvocationonthepageContextobject,insertedatline6,assignsbartothevariablex?()A.Stringx=(String)pageContext.getAttribute(foo)B.Stringx=(String)pageContext.getRequestScope(foo)C.ItisNOTpossibletoaccessthepageContextobjectfromwithindoStartTagD.Stringx=(String)pageContext.getRequest().getAttribute(foo)E.Stringx=(String)pageContext.getAttribute(foo,PageContext.ANY_SCOPE)

考题 publicclassFoo{publicinta;publicFoo(){a=3;}publicvoidaddFive(){a+=5;}}and:publicclassBarextendsFoo{publicinta;publicBar(){a=8;}publicvoidaddFive(){this.a+=5;}}invokedwith:Foofoo=newBar();foo.addFive();System.out.println(”Value:+foo.a);Whatistheresult?()A.Value:3B.Value:8C.Value:13D.Compilationfails.E.Thecoderunswithnooutput.F.Anexceptionisthrownatruntime.

考题 publicclassBase{publicstaticfinalStringFOO=foo”;publicstaticvoidmain(String[]args){Baseb=newBase();Subs=newSub();System.out.print(Base.FOO);System.out.print(Sub.FOO);System.out.print(b.FOO);System.out.print(s.FOO);System.out.print(((Base)s).FOO);}}classSubextendsBase{publicstaticfinalStringFOO=bar;}Whatistheresult?()A.foofoofoofoofooB.foobarfoobarbarC.foobarfoofoofooD.foobarfoobarfooE.barbarbarbarbarF.foofoofoobarbarG.foofoofoobarfoo

考题 intindex=1;int[]foo=newint[3];intbar=foo[index];intbaz=bar+index;Whatistheresult?() A.Bazhasthevalueof0B.Bazhasthevalueof1C.Bazhasthevalueof2D.Anexceptionisthrown.E.Thecodewillnotcompile.

考题 publicclassDelta{staticbooleanfoo(charc){System.out.print(c);returntrue;}publicstaticvoidmain(String[]argv){inti=0;for(foo(‘A’);foo(‘B’)(i2);foo(‘C’)){i++;foo(‘D’);}}}Whatistheresult?() A.ABDCBDCBB.ABCDABCDC.Compilationfails.D.Anexceptionisthrownatruntime.