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.
第1题:
String foo = “blue”; Boolean[]bar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result? ()
第2题:
public class test( public static void main(stringargs){ string foo = args [1]; string foo = args ; string foo = args ; } ) And command line invocation: Java Test red green blue What is the result? ()
第3题:
int index = 1; int [] foo = new int [3]; int bar = foo [index]; int baz = bar + index; What is the result?()
第4题:
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?()
第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题:
Baz has the value of “”
Baz has the value of null
Baz has the value of “red”
Baz has the value of “blue”
Bax has the value of “green”
The program throws an exception.
第8题:
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.
第9题:
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
第10题:
Baz has the value of “”
Baz has the value of null
Baz has the value of “red”
Baz has the value of “blue”
Bax has the value of “green”
The program throws an exception.
第11题:
foo has the value””
foo has the value null.
An exception is thrown.
The code will not compile.
第12题:
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.
第13题:
int index = 1; int foo = new int ; int bar = foo [index]; int baz = bar + index; What is the result?()
第14题:
Given the HttpServlet code: getServletContext().setAttribute(“foo”, “value”); What is the result?()
第15题:
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
第16题:
int index = 1; boolean[] test = new Boolean[3]; boolean foo= test [index]; 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 “”
Foo has the value null
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题:
Foo has the value “”
Foo has the value null
An exception is thrown
The code will not compile
第22题:
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.
第23题:
String value = getServletConfig( ).getParameter(“foo”);
String value = getServletContext( ).getAttribute(“foo”);
Object value = getServletContext( ).getInitParameter(“foo”);
String value = getServletContext( ).getInitParameter(“foo”)