问题:多选题Which two are valid declarations of char?()AChar ch = “a”;Bchar ch = “”;Cchar ch = “café”;Dchar ch = “ucafe”;Echar ch = “ucafe’;Fchar ch = “u10100’;Gchar ch = (char) true;
查看答案
问题:单选题Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()Ajavax.servlet.http.HttpSessionListenerBjavax.servlet.http.HttpSessionValueListenerCjavax.servlet.http.HttpSessionBindingListenerDjavax.servlet.http.HttpSessionAttributeListener
问题:单选题Which is the valid identifier?()AfalseBdefaultC_objectDa-class
问题:多选题Given a header in an HTTP request: X-Retries:4 Which two retrieve the value of the header from a given ServletRequest request? ()Arequest.getHeader (“X-Retries”)Brequest.getIntHeader (“X-Retries”)Crequest.getRequestHeader (“x-Retries”)Drequest.getHeaders (“X-Retries”).get (0)Ere request.getRequest Headers (“X-Retries”). Get (0)
问题:单选题Which command line invocation will produce the output?()Ajava Test 2222Bjava Test 1234Cjava Test 4242Djava Test 4321
问题:单选题Which HTTP method has the characteristic that multiple indential requests may produce side effect beyond those of a single request()?APUTBGETCINFODPOSTEHEADFTRACE
问题:单选题Which option prevents the exception thrown by my:errorProne from invoking the error page mechanism and outputs the message "File not found" in the response?()AABBCCDDEE
问题:多选题Which two are characteristics of the Intercepting Filter pattern?()Ait provides centralized request handling for incoming requests.BIt forces resource authentication to be distributed across web components.CIt reduces coupling between presentation-tier clients and underlying business services.DIt can be added and removed unobtrusively, without requiring changes to existing code.EIt allows preprocessing and postprocessing on the incoming requests and outgoing responses.
问题:多选题For which three events can web application event listeners be registered? ()Awhen a session is createdBafter a servlet is destroyedCwhen a session has timed outDwhen a cookie has been createdEwhen a servlet has forwarded a requestFwhen a session attribute value is changed
问题:单选题Company.com has decided to use the FUBAR Application Server to host their web application. Unfortunately, the FUBAR Application Server uses the server machine’s file system for its JNDI namespace. Every JNDI lookup performed in the web application is translated into a file 1/0 operation, which results in very poor performance. Which J2EE pattern can help with this performance issue?()ATransfer ObjectBService LocatorCIntercepting FilterDModel-View-Controller
问题:单选题Which interface must a class implement to be informed of a session creation event?()Ajavax.servlet.http.HttpSessionListenerBjavax.servlet.http.HttpSessionBindingListenerCjavax.servlet.http.HttpSessionCreationListenerDjavax.servlet.http.HttpSessionActivationListener
问题:单选题} What is the result?()ACompilation succeeds and 1 is printed.BCompilation succeeds and 2 is printed.CAn error at line 8 causes compilation to fail.DAn error at line 14 causes compilation to fail.
问题:单选题A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of the com.Company. Product class with a name property of “The Matrix” and price property of 39.95. Given the JSP page code snippet: What is the response output of this JSP page code snippet? ()ADefault costs 0.0BDefault costs 49.95CDefault costs 39.95DThe Matrix costs 0.0EThe Matrix costs 49.95FThe Matrix costs 39.95
问题:单选题Which thefollowingstatements about static inner classes is true?()AAn anonymous class can be declared as static.BA static inner class cannot be a static member of the outer class.CA static inner class does not require an instance of the enclosing class.DInstance member of a static inner class can be referenced using the class name of the staticinner class.
问题:单选题For a given ServletResponse response, which retrieves an object for writing binary data?()Aresponse.getWriter()Bresponse.getOutputStream()Cresponse.getOutputWriter()Dresponse.getWriter().getOutputSTream()Eresponse.getWriter(Writer.OUTPUT_BINARY)
问题:单选题Assume the tag handler for a st:simpletag extends SimpleTagSupport. In what way can scriptlet code be used in the body of st:simple?()ASet the body content type to JSP in the TLDBScriptlet code is NOT legal in the body of st:simpleCAdd scripting-enabled= “true” to the start tag for the st:simple elementDAdd a pass-through Classic tag with a body content type of JSP to the body of st:simple, and place the scriptlet code in the body of that tag.
问题:单选题Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()Arequest.add Cookie (“username”. “joe”)Brequest.set Cookie (“username, “joe”)Cresponse.add Cookie (username”, “joe”))Drequest.add Header (new Cookie (“username”, “joe”))Erequest.add Cookie (new Cookie (“username”, “joe”))Fresponse.add Cookie (new Cookie (“username”, “joe”))Gresponse.add Header (new Cookie (“username”, “joe”))
问题:单选题1. class A { 2. public byte file Number ( ) { 3. return l; 4. } 5. } 6. 7. Class B extends A { 8. public short getNumber( ) { 9. return 2; 10. } 11. 12. public short getNumber( ) { 13. B b = new B( ); 14. System.out.printIn(b.getNumber( )); 15. } 16. } What is the result()?ACompilation succeeds and l is printed.BCompilation succeeds and 2 printed.CAn error at line 8 cause compilation to fail.DAn error at line 14 cause complication to fail.EComplication succeeds but an exception is thrown at line 14.
问题:单选题Which the HTTP method represents a request for information about the supported methods on an HTTP server?()AGETBINFOCHEADDTRACEEOPTIONS