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题:
test
Exception
Compilation fails.
NullPointerException
第4题:
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.
第5题:
test
Exception
Compilation fails.
NullPointerException
第6题:
23
234
235
Compilation fails.
第7题:
An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第8题:
TestA
TestB
Compilation fails.
An exception is thrown at runtime.
第9题:
null
finally
null finally
Compilation fails.
finally exception
第10题:
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
第11题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main at runtime.
第12题:
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.
第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题:
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.
第16题:
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.
第17题:
TestA
TestB
Compilation fails.
An exception is thrown at runtime.
第18题:
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.
第19题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第20题:
Canada
null Canada
Canada null
Canada Canada
Compilation fails due to an error on line 26.
第21题:
finished
Exception
Compilation fails.
Arithmetic Exception
第22题:
Afoo Afoo
Afoo Bfoo
Bfoo Afoo
Bfoo Bfoo
Compilation fails.
An exception is thrown at runtime.
第23题:
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.
第24题:
Hello
Hello World
Compilation fails.
Hello World 5
The code runs with no output.
An exception is thrown at runtime.