2
24
234
246
2346
第1题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.
第2题:
2
3
12
23
123
Compilation fails.
An exception is thrown at runtime.
第3题:
2
24
234
246
2346
Compilation fails.
第4题:
0
The result is undefined.
a
2
1
c
b
第5题:
[1, 2, 3, 5]
[2, 1, 3, 5]
[2, 5, 3, 1]
[5, 3, 2, 1]
[1, 3, 5, 2]
第6题:
An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第7题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第8题:
null
finally
null finally
Compilation fails.
finally exception
第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题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main at runtime.
第11题:
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.
第12题:
2
4
8
16
The code will not compile.
第13题:
test
Exception
Compilation fails.
NullPointerException
第14题:
Compilation fails.
An exception is thrown at runtime.
The code executes normally and prints "sleep".
The code executes normally, but nothing is printed.
第15题:
B
B, followed by an Exception.
Compilation fails due to an error on line 9.
Compilation fails due to an error on line 14.
An Exception is thrown with no other output.
第16题:
Compilation fails.
An exception is thrown at runtime.
The code executes and prints "running".
The code executes and prints "runningrunning".
The code executes and prints "runningrunningrunning".
第17题:
<b></b>
<b>12</b>
The JSP fails to execute.
<% int i = 12 %><b><%= i %></b>
第18题:
A
B
C
D
E
第19题:
Canada
null Canada
Canada null
Canada Canada
Compilation fails due to an error on line 26.
第20题:
–2
NaN
Infinity
Compilation fails.
An exception is thrown at runtime.
第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题:
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.
第23题:
5,6
5,5
6,5
6,6