The attribute foo is placed in the application
A ServletContextListener registered for that servlet is notified
A ServletAttributeListener registered for that servlet is notified
An HttpSessionAttributeListener registered for that servlet is notified
第1题:
Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains:
第2题:
Given: 8.int index = 1: 9.Boolean [] test = new boolcan [3]; 10.boolcan foo = test [index]; What is the result()?
第3题:
int index = 1; int foo = new int ; int bar = foo [index]; int baz = bar + index; What is the result?()
第4题:
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
第5题:
Foo has the value of 0.
Foo has the value of null.
Foo has the value of true.
Foo has the value of false.
An exception is thrown.
The code will not compile.
第6题:
Value: 3
Value: 8
Value: 13
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第7题:
Foo has the value “”
Foo has the value null
An exception is thrown
The code will not compile
第8题:
The foo initialization parameter CANNOT be set programmatically.
Compilation fails because getInitParameter returns type Object.
The foo initialization parameter is NOT a servlet initialization parameter.
Compilation fails because ServletContext does NOT have a getInitParameter method.
The foo parameter must be defined within the
第9题:
foo has the value of 0.
foo has the value of null.
foo has the value of true.
foo has the value of false.
An-exception is thrown.
The code will not compile.
第10题:
The attribute foo is placed in the application
A ServletContextListener registered for that servlet is notified
A ServletAttributeListener registered for that servlet is notified
An HttpSessionAttributeListener registered for that servlet is notified
第11题:
Foo has the value of 0.
Foo has the value of null.
Foo has the value of true.
Foo has the value of false.
An exception is thrown.
The code will not compile.
第12题:
String value = getServletConfig( ).getParameter(“foo”);
String value = getServletContext( ).getAttribute(“foo”);
Object value = getServletContext( ).getInitParameter(“foo”);
String value = getServletContext( ).getInitParameter(“foo”)
第13题:
int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()
第14题:
String foo = “blue”; Boolean[]bar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result? ()
第15题:
Given the HttpServlet code: getServletContext().setAttribute(“foo”, “value”); What is the result?()
第16题:
public class Foo { public int a; public Foo() { a = 3; } public void addFive() { a += 5; } } and: public class Bar extends Foo { public int a; public Bar() { a = 8; } public void addFive() { this.a +=5; } } invoked with: Foo foo = new Bar(); foo.addFive(); System.out.println(”Value: “+ foo.a); What is the result?()
第17题:
${true or false}
${requestScope[foo][0] > 500}
${requestScope[’foo’][1] = 420}
${(requestScope[’foo’][0] lt 50) && (3 gt 2)}
第18题:
Baz has the value of 0
Baz has the value of 1
Baz has the value of 2
An exception is thrown.
The code will not compile.
第19题:
Foo has the value of “”
Foo has the value of null.
Foo has the value of “blue”
Foo has the value of “green”
An exception is thrown.
The code will not compile.
第20题:
Foo has the value of “”
Foo has the value of null.
Foo has the value of “blue”
Foo has the value of “green”
An exception is thrown.
The code will not compile.
第21题:
The foo initialization parameter CANNOT be set programmatically.
Compilation fails because getInitParameter returns type Object.
The foo initialization parameter is NOT a servlet initialization parameter.
Compilation fails because ServletContext does NOT have a getInitParameter method.
The foo parameter must be defined within the
第22题:
Foo has the value “”
Foo has the value null
An exception is thrown
The code will not compile
第23题:
foo has the value””
foo has the value null.
An exception is thrown.
The code will not compile.
第24题:
Baz has the value of 0
Baz has the value of 1
Baz has the value of 2
An exception is thrown.
The code will not compile.