单项选择题

A.abstractclassVehicle{publicintspeed(){return0;}}12.classCarextendsVehicle{publicintspeed(){return60;}}13.classRaceCarextendsCar{publicintspeed(){return150;}}......21.RaceCarracer=newRaceCar();22.Carcar=newRaceCar();23.Vehiclevehicle=newRaceCar();24.System.out.println(racer.speed()+,?+car.speed()25.+,+vehicle.speed());Whatistheresult?()
A.0,0,0
B.150,60,0
C.Compilationfails.
D.150,150,150
E.Anexceptionisthrownatruntime.
相关考题

单项选择题 10.publicclassHello{11.Stringtitle;12.intvalue;13.publicHello(){14.title+=World”;15.}16.publicHello(intvalue){17.this.value=value;18.title=Hello”;19.Hello();20.}21.}and:30.Helloc=newHello(5);31.System.out.println(c.title);Whatistheresult?()A.HelloB.HelloWorldC.Compilationfails.D.HelloWorld5E.Thecoderunswithnooutput.F.Anexceptionisthrownatruntime.

单项选择题 classClassA{publicintnumberOfinstances;protectedClassA(intnumberOfinstances){this.numberOflnstances=numberOfinstances;}}publicclassExtendedAextendsClassA{privateExtendedA(intnumberOfinstances){super(numberOflnstances);}publicstaticvoidmain(String[]args){ExtendedAext=newExtendedA(420);System.out.print(ext.numberOflnstances);}}Whichistrue?()A.420istheoutput.B.Anexceptionisthrownatruntime.C.Allconstructorsmustbedeclaredpublic.D.ConstructorsCANNOTusetheprivatemodifier.E.ConstructorsCANNOTusetheprotectedmodifier.

单项选择题 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

单项选择题 classDemoApp{publicstaticvoidmain(String[]args){intx=5;inty=++x+x++;System.out.println(y=”+y+”,x=”+x);}}以上程序运行后的输出结果是哪项?()

单项选择题 Youarebuildingyourownlayoutmechanismbyincludingdynamiccontentforthepage’sheaderandfootersections.Thefooterisalwaysstatic,buttheheadergeneratesthe<title>tagthatrequiresthepagenametobespecifieddynamicallywhentheheaderisimported.WhichJSPcodesnippetperformstheimportoftheheadercontent?()A.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:include>B.<jsp:importpage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:import>C.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:include>D.<jsp:importpage=’/WEB-INF/jsp/header.jsp’>.<jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:import>

单项选择题 WhichisabenefitofprecompilingaJSPpage?()

单项选择题 TheJSPdeveloperwantsacommenttobevisibleinthefinaloutputtothebrowser.WhichcommentstyleneedstobeusedinaJSPpage?()

单项选择题 WhichensuresthataJSPresponseisoftype'text/plain'?()

单项选择题 WhichHttpSessionmethodstoresanobjectinasession?()

单项选择题 ACompany.comdeveloperisdesigningamulti-tierwebapplicationanddiscoversaneedtohidethedetailsofestablishingandmaintainingremotecommunicationsfromtheclient.Inaddition,becausethebusinessandresourcetiersaredistributed,theapplicationneedstominimizetheinter-tiernetworktrafficrelatedtoservicingclientrequests.Whichdesignpatterns,workingtogether,addresstheseissues?()A.FrontControllerandTransferObjectB.FrontControllerandServiceLocatorC.BusinessDelegateandTransferObjectD.BusinessdelegateandInterceptingFilterE.Model-View-ControllerandInterceptingFilter

单项选择题 Whichinterfacemustasessionattributeimplementifitneedstobenotifiedwhenawebcontainerpersistsasession?()

单项选择题 AwebapplicationusestheHttpSessionmechanismtodetermineifauseris"loggedin."Whenausersuppliesavalidusernameandpassword,anHttpSessioniscreatedforthatuser.Theuserhasaccesstotheapplicationforonly15minutesafterloggingin.Thecodemustdeterminehowlongtheuserhasbeenloggedin,andifthistimeisgreaterthan15minutes,mustdestroytheHttpSession.Whichmethodin HttpSessionisusedtoaccomplishthis?()A.GetcreationtimeB.InvalidateafterC.GetlastaccessedtimeD.Getmaxinactiveinterval

单项选择题 GivenanHttpServletRequestrequestandanHttpServletResponseresponse:41.HttpSessionsession=null;42.//insertcodehere43.if(session==null){44.//dosomethingifsessiondoesnotexist45.}else{46.//dosomethingifsessionexists47.}Toimplementthedesignintent,whichstatementmustbeinsertedatline42?()A.session=response.getSession();B.session=request.getSession();C.session=request.getSession(true);D.session=request.getSession(false);E.session=request.getSession("jsessionid");

单项选择题 WhichmethodmustbeusedtoencodeaURLpassedasanargumenttoHttpServletResponse.sendRedirectwhenusingURLrewritingforsessiontracking?()

单项选择题 AJSPpageneedstoperformsomeoperationsbeforeservicingthefirstrequest.Wherecanthisbedone?()

单项选择题 Youarebuildingawebapplicationwithaschedulingcomponent.OntheJSP,youneedtoshowthecurrentdate,thedateofthepreviousweek,andthedateofthenextweek.Tohelpyoupresentthisinformation,youhavecreatedthefollowingELfunctionsinthe’d’namespace:name:curDate;signature:java.util.DatecurrentDate()name:addWeek;signature:java.util.DateaddWeek(java.util.Date,int)name:dateString;signature:java.util.StringgetDateString(java.util.Date)WhichELcodesnippetwillgeneratethestringforthepreviousweek?A.${d:dateString(addWeek(curDate(),-1))}B.${d:dateString[addWeek[curDate[],-1]]}C.${d:dateString[d:addWeek[d:curDate[],-1]]}D.${d:dateString(d:addWeek(d:curDate(),-1))}

单项选择题 钱掌柜的买家级别设置不包含以下哪几个等级?()

单项选择题 抵价券的面值没有以下哪种?()

单项选择题 商业信息传播的维度中没有以下哪个?()

单项选择题 支付宝是淘宝唯一的在线付款方式,安全交易的手段不包含以下哪个?()