2.1.0
2.1.1
3.2.1
3.2.2
第1题:
Given the HttpServlet code: getServletContext().setAttribute(“foo”, “value”); What is the result?()
第2题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.
第3题:
2
3
12
23
123
Compilation fails.
An exception is thrown at runtime.
第4题:
2
24
234
246
2346
Compilation fails.
第5题:
0
The result is undefined.
a
2
1
c
b
第6题:
<b></b>
<b>12</b>
The JSP fails to execute.
<% int i = 12 %><b><%= i %></b>
第7题:
A
B
C
D
E
第8题:
Canada
null Canada
Canada null
Canada Canada
Compilation fails due to an error on line 26.
第9题:
0
1
4
Compilation fails.
第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题:
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题:
5,6
5,5
6,5
6,6
第13题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第14题:
test
Exception
Compilation fails.
NullPointerException
第15题:
Compilation fails.
An exception is thrown at runtime.
The code executes normally and prints "sleep".
The code executes normally, but nothing is printed.
第16题:
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.
第17题:
[1, 2, 3, 5]
[2, 1, 3, 5]
[2, 5, 3, 1]
[5, 3, 2, 1]
[1, 3, 5, 2]
第18题:
An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第19题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第20题:
null
finally
null finally
Compilation fails.
finally exception
第21题:
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
第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.