单项选择题


What is the result?()

A. The program runs and prints “Hello”
B. An error causes compilation to fail.
C. The program runs and prints “Hello world!”.
D. The program runs but aborts with an exception.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题


What is the result?()

A. foo has the value””
B. foo has the value null.
C. An exception is thrown.
D. The code will not compile.

2.单项选择题Which the statement is true?()

A. The Error class is a Runtime Exception.
B. No exceptions are subclasses of Error.
C. Any statement that may throw an Error must be enclosed in a try block.
D. any statement that may throw an Exception must be enclosed in a try block.
E. Any statement that may throw an Runtime Exception must be enclosed in a try block.

3.单项选择题


Which code snippet inserted at line 12 cause the client to redirect tohttp://www.example.com?()

A. response.send Redirect (http://www.example.com):
B. response.send Redirect (new URL (“http://www.example.com”));
C. Request Dispatcher rd=  get Servlet Context (). Get Request Dispatcher (  http://www.example.com”)’  rd. forward (request. Response):
D. Request Dispatch rd=  Get Servlet Context ().get Request Dispatcher(  New URL (http://www.example.com));  Rd. forward (request.response):

4.单项选择题Given an Http Session session. A Servlet Request request. And a Servlet Context context. Which retrieves a URL to /WEB INF/ my config.xml within a web application?()

A. session.get Resource (“/WEB-INF/myconfig.xml”)
B. request.get Resource (“/WEB-INF/myconfig.xml”)
C. context.get Resource (“/WEB-INF/myconfig.xml”)
D. get Class ().get Resource (“/WEB-INF/myconfig.xml”)

5.单项选择题Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()

A. abstract public void methoda ();
B. public abstract double inethoda ();
C. static void methoda (double dl) {}
D. public native double methoda () {}
E. protected void methoda (double dl) {}

6.多项选择题Which the three are valid declarations of a float?()

A. float foo = -1;
B. float foo = 1.0;
C. float foo = 42el:
D. float foo = 2.02f:
E. float foo = 3.03d:

7.多项选择题Which the two demonstrate encapsulation of data?()

A. Member data have no access modifiers.
B. Member data can be modified directly.
C. The access modifier for methods is protected.
D. The access modifier to member data is private.
E. Methods provide for access and modification of data.

8.单项选择题


What OrderSErvlet method is invoked as a result of this from submission?()

A. doGET
B. doPUT
C. doPost
D. doTrace
E. doSubmit

9.单项选择题

After execution. What are the values for i and j ()

A. i = 6 and j = 5
B. i = 5 and j = 5
C. i = 6 and j = 4
D. i = 6and j = 6

10.单项选择题


Which statement at Point X on line 1 allows this code to compile and run?()

A. import java.io.*.;
B. include java.io.*;
C. import java.io.PrintWriter;
D. include java.io.PrintWRiter;
E. No statement in needed.

最新试题

Which the JSTL code snippet can be used to import content from another web resource?()

题型:单项选择题

Given that session is a valid HttpSession object:  Int max = session.getAttribute(“MyReallyLongName”);  Which is true?()  

题型:单项选择题

Within the web application deployment descriptor, which defines a valid JNDI environment entry()

题型:单项选择题

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? ()

题型:单项选择题

Which two classes or interfaces provide a getSession method?()

题型:多项选择题

What code, inserted at line 21, is called prior to a session being migrated to a different JVM assuming the web application containing MyExample is deployed in a container which supports distributed applications?()

题型:单项选择题

Which the two are characteristics of the Service Locator pattern?()

题型:多项选择题

Given a web application in which the request parameter product ID contains a product identifier.Which two EL expressions evaluate the value of the product ID?()

题型:多项选择题

Which statement, at line 16, retrieves an InputStream for the file /WEBINF/ nyresrc.bin()?

题型:单项选择题

When using Form Based Authentication, which pair of fields must be used in the login form?()  

题型:单项选择题