单项选择题


What is the result?()

A. The program runs and prints “0”
B. The program runs and prints “1”
C. The program runs but aborts with an exception.
D. An error “possible undefined variable” at line 4 causes compilation to fail.
E. An error “possible undefined variable” at line 9 cause compilation to fail.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题


What is the result()?  

A. 2
B. 4
C. 8
D. 16
E. The code will not compile.

2.多项选择题Which the two demonstrate an “is a” relationship?()

A. public interface Person {}  Public class Employee extends Person {}
B. public interface Shape {}  public interface Rectangle extends Shape {}
C. public interface Color {}  public class Shape { private Color color; }
D. public class Species {}  public class Animal { private Species species; }
E. interface Component {} Class Container implements Component {private Component [] children;

3.多项选择题


Which two overload the setVar method()

A.A
B.B
C.C
D.D
E.E

4.单项选择题Which thefollowingstatements about static inner classes is true?()

A. An anonymous class can be declared as static.
B. A static inner class cannot be a static member of the outer class.
C. A static inner class does not require an instance of the enclosing class.
D. Instance member of a static inner class can be referenced using the class name of the staticinner class.

5.多项选择题Which the following two statements are true?()

A. An inner class may be declared as static.
B. An anonymous inner class can be declared as public.
C. An anonymous inner class can be declared as private.
D. An anonymous inner class can extend an abstract class.
E. An anonymous inner class can be declared as protected.

6.多项选择题Under what two circumstances is the set JspBody method NOT called in a tag class that implements the Simple Tag interface? ()

A. The tag is invoked without a body.
B. The doTAb method throws an exception.
C. The  element has the value empty.
D. The tag is called with the attribute skip-body=true

8.单项选择题


Which statement inserted at line II, retrieves the text from the second text field?()

A. second = request.getParameter (“foo”):
B. second = request.getParameter (“foo”, 1):
C. second = request.getParameter (“foo”,2):
D. second = request.getParameter (foo”) [1]:
E. second = request.getParameter Values (“foo”) [1]:

9.单项选择题


Which retrieves the binary input stream on line 13?()  

A. request.get Writer ():
B. request.get Reader ():
C. request.get Input Stream():
D. request.get Resource As Stream():
E. request.get Resource As Stream (Servlet Request. REQUEST):

10.单项选择题Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()

A. request.add Cookie (“username”. “joe”)
B. request.set Cookie (“username, “joe”)
C. response.add Cookie (username”, “joe”))
D. request.add Header (new Cookie (“username”, “joe”))
E. request.add Cookie (new Cookie (“username”, “joe”))
F. response.add Cookie (new Cookie (“username”, “joe”))
G. response.add Header (new Cookie (“username”, “joe”))

最新试题

Which code snippet, inserted at line 8, causes the value Company to be output?()

题型:单项选择题

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

题型:单项选择题

Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()

题型:单项选择题

The tag handler for n:recurse extends SimpleTagSupport.Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?()  

题型:单项选择题

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

题型:单项选择题

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 three are true about servlet filters?()

题型:多项选择题

Which two are true?()

题型:多项选择题

Which the two are true regarding a web application class loader?()

题型:多项选择题

A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed. Which two are true? ()

题型:多项选择题