相关考题

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

单项选择题 Given:1.<%int[]nums={42,420,4200};2.request.setAttribute("foo",nums);%>3.${5+3lt6}4.${requestScope[’foo’][0]ne10div0}5.${10div0}Whatistheresult?()

单项选择题 WhichHTTPmethodrepresentsarequestforinformationaboutthesupportedmethodsonanHTTPserver?()

单项选择题 GivenanHttpServletRequestrequestandHttpServletResponseresponse,whichsetsacookie“username”withthevalue“joe”inaservlet.?()

单项选择题 GiventhisfragmentfromaJavaEEdeploymentdescriptor:124.<welcome-file>beta.html</welcome-file>125.<welcome-file>alpha.html</welcome-file>Andthisrequestfromabrowser:http://www.sun.com/SCWCDtestApp/registerWhichstatementiscorrect,whenthecontainerreceivesthisrequest?()A.ThisdeploymentdescriptorisNOTvalid.B.Thecontainerfirstlooksintheregisterdirectoryforbeta.html.C.Thecontainerfirstlooksintheregisterdirectoryforalpha.html.D.Thecontainerfirstlooksforaservletmappinginthedeploymentdescriptor.

单项选择题 Youarebuildingadatingwebsite.Theclient’sdateofbirthiscollectedalongwithlotsofotherinformation.YouhavecreatedanELfunctionwiththesignature:calcAge(java.util.Date):intanditisassignedtothename,age,inthenamespace,funct.InoneofyourJSPsyouneedtoprintaspecialmessagetoclientswhoareyoungerthan25.WhichELcodesnippetwillreturntrueforthiscondition?()A.${calcAge(client.birthDate)<25}B.${calcAge[client.birthDate]<25}C.${funct:age(client.birthDate)<25}D.${funct:age[client.birthDate]<25}E.${funct:calcAge(client.birthDate)<25}