int index = 1; String test = new String; String foo = test[index]; What is the result?()
第1题:
int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()
第2题:
String foo = “blue”; Boolean[]bar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result? ()
第3题:
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? ()
第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题:
Value: 3
Value: 8
Value: 13
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第6题:
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.
第7题:
Foo has the value “”
Foo has the value null
An exception is thrown
The code will not compile
第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题:
Foo has the value “”
Foo has the value null
An exception is thrown
The code will not compile
第10题:
An exception is thrown.
The code will not compile.
The program prints “null”
The program prints “blue”
The program prints “green”
第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题:
Given: 8.int index = 1: 9.Boolean [] test = new boolcan [3]; 10.boolcan foo = test [index]; What is the result()?
第14题:
int index = 1; int foo = new int ; int bar = foo [index]; int baz = bar + index; What is the result?()
第15题:
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
第16题:
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.
第17题:
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.
第18题:
baz =
baz = null
baz = blue
Compilation fails.
An exception is thrown at runtime.
第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 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.
第21题:
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.
第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”)