test
Exception
Compilation fails.
NullPointerException
第1题:
public class Test { private static int[] x; public static void main(String[] args) { System.out.println(x[0]); } } What is the result?()
第2题:
0
null
Compilation fails.
A NullPointerException is thrown at runtime.
An ArrayIndexOutOfBoundsException is thrown at runtime.
第3题:
Compilation succeeds.
Compilation fails due to multiple errors.
Compilation fails due to an error only on line 20.
Compilation fails due to an error only on line 21.
Compilation fails due to an error only on line 22.
第4题:
Canada
null Canada
Canada null
Canada Canada
Compilation fails due to an error on line 26.
Compilation fails due to an error on line 29.
第5题:
TestA
TestB
Compilation fails.
An exception is thrown at runtime.
第6题:
A new Item object is created with the preferred value in the id attribute.
The attribute id in the Item object is modified to the new value.
Compilation fails.
An exception is thrown at runtime.
The attribute id in the Item object remains unchanged.
第7题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第8题:
Canada
null Canada
Canada null
Canada Canada
Compilation fails due to an error on line 26.
第9题:
finished
Exception
Compilation fails.
Arithmetic Exception
第10题:
Afoo Afoo
Afoo Bfoo
Bfoo Afoo
Bfoo Bfoo
Compilation fails.
An exception is thrown at runtime.
第11题:
True
Not true
An exception is thrown at runtime.
Compilation fails because of an error at line 12.
Compilation fails because of an error at line 19.
第12题:
Hello
Hello World
Compilation fails.
Hello World 5
The code runs with no output.
An exception is thrown at runtime.
第13题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第14题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.
第15题:
test
null
An exception is thrown at runtime.
Compilation fails because of an error in line 1.
Compilation fails because of an error in line 4.
Compilation fails because of an error in line 5.
第16题:
test
Exception
Compilation fails.
NullPointerException
第17题:
23
234
235
Compilation fails.
第18题:
An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第19题:
TestA
TestB
Compilation fails.
An exception is thrown at runtime.
第20题:
null
finally
null finally
Compilation fails.
finally exception
第21题:
An Exception is thrown with no other output
followed by an Exception
Compilation fails due to an error on line 9
Compilation fails due to an error on line 14
第22题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main at runtime.
第23题:
B
The code runs with no output.
Compilation fails because of an error in line 12.
Compilation fails because of an error in line 15.
Compilation fails because of an error in line 18.