单项选择题


What is the result?()

A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because Strings is not initialized.
D. The code does not compile because because Strings cannot be referneed.
E. The code comiles.butt a NullPointerException is thrown when toString is called.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题Which two are valid declarations of char?()

A. Char ch = “a”;
B. char ch = “”;
C. char ch = “café”;
D. char ch = “ucafe”;
E. char ch = “ucafe’;
F. char ch = “u10100’;
G. char ch = (char) true;

2.多项选择题


Which three logical expressions evaluate to true?()

A. (a = = c)
B. (d = = c)
C. (b = = d)
D. (a = = b)
E. (b = = c)
F. (d == 10.0)

3.单项选择题


What is the result? ()

A. The program prints “lava”.
B. The program prints “java”.
C. An error at line 7 causes compilation to fail.
D. Complication succeeds but the program throws an exception.

4.单项选择题

}
What is the result?()

A. Compilation succeeds and 1 is printed.
B. Compilation succeeds and 2 is printed.
C. An error at line 8 causes compilation to fail.
D. An error at line 14 causes compilation to fail.

5.多项选择题Which thethree are valid URL mappings to a servlet in a web deployment descriptor? ()

A. */*
B. /*.do
C. myServlet
D. /Myservlet
E. /MyServlet/*
F. MyServlet/*.isp

7.多项选择题For a given Servlet Response response, which retrieves an object for writing binary data? ()

A. response.get writer ()
B. response.get Output Stream ()
C. response.getOutput Writer()
D. response.get Writer ().get Output Stream ()
E. response.get Writer (Writer.OUTPUT_BINARY)

9.单项选择题

Given 
1.  public class Foo { 
2.  public static void main (String [] args) } 
3.  try { return;} 
4.  finally { Syste.out.printIn (“Finally”);} 
5. } 
6. }  
What is the result()?

A. The program runs and prints nothing.
B. The program runs and prints “Finally”.
C. The code comiles. But an exception is thrown at runtime.
D. The code will not compile because the catch block is missing.

10.多项选择题

Given: 
1.  public interface Foo { 
2.  int k = 4: 
3.  }  
Which three are equivalent to line 2?()

A. final int k = 4:
B. public int k = 4:
C. static int k = 4:
D. private int k = 4:
E. abstract int k = 4:
F. volatile int k = 4:
G. transient int k = 4:
H. protected int k = 4:

最新试题

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

题型:多项选择题

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 three can be placed at line 23 to retrieve an existing HttpSession object?()

题型:多项选择题

Which the three EL expressions, inserted at line 15, are valid and evaluate to "3"? ()

题型:多项选择题

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 three are guaranteed to be valid for the  element of a web application deployment descriptor?()

题型:多项选择题

A web application uses the HttpSession mechanism to determine if a user is “logged in”. When a user supplies a valid user name and password, an HttpSession is created for that user. The user has access to the application for only 15 minutes after logging in. The code must determine how long the user has been logged in, and if this time is greater than 15 minutes, must destroy the HttpSession. Which method in HttpSession is used to accomplish this?()

题型:单项选择题

A developer for the Company.com web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?()  

题型:单项选择题

For a given product instance, which three jsp:setProperty attributes must be used to initialized its properties form the HTML form? ()

题型:多项选择题

A JSP page, current.jsp, is created to display the current weather report. The weather report is contained in a weather.html page that is rewritten every five minutes. Which line, appearing in current.jsp, ensures that the most recent version of weather.html is included whenever current.jsp is referenced?()

题型:单项选择题