</p> 10. void go() {
) z9 f$ B, n: e+ d: g3 [3 I 11. System.out.println(s);. v, \, p! W7 x3 Q: P [/ P3 V" y* Y
12. }9 g0 o, d6 \: M' @
13. }
' }$ k) M6 z3 S( h f5 y a. The code compiles and throws an exception at run time.( A# W7 {# C& T1 u
b. The code runs, but nothing appears in the standard output.
0 U7 ]+ V$ S' C3 d c. The code runs, and “constructor” appears in the standard output./ P8 f' q8 i$ ^$ k% M$ F8 d8 f
d. The code runs and writes “null” in the standard output.
+ I' ?, c( B% u: c: W/ J/ s Q54.What can you write at the comment //A in the following code so that this program writes the word “running” to the standard output?, t0 ?: o4 z# `
1. class RunTest implements Runnable {- i2 i' j4 h Y) s/ \8 Y5 u
2. public static void main(String args[]) {
3 r: o7 e; M6 w1 f 3. RunTest rt = new RunTest();; [6 B" H- G% q, z7 }/ f- Y
4. Thread t = new Thread(rt);
# l) E5 s- V. o 5. //A1 Z6 ^6 q$ @# B! H* Q, S+ W6 N
6. }
) O4 k! Q. c, ~+ ^" u4 @! v 7. public void run() {
3 g _" J6 `3 W i 8. System.out.println(“running”);
7 v, d2 t7 Y+ p' b: T# S 9. }
: W9 G8 T, o0 _3 M( K 10. void go() {
! h: f3 q& w0 n( a2 C 11. start(1);
$ Z& c2 Y8 g9 _6 y7 g 12. }
% P' \# s' R) B. D 13. void start(int i) {. {1 @# D( T# n- K; H1 H) P* [2 m4 z
14. }- S6 y- O& I: X# O6 Z
15. }
y2 P1 e6 Q0 m, v Select all valid answers.
( R3 a# o. I+ q* I5 b, ^% ? a. System.out.println(“running”);
$ u1 h& d" S, L5 v* ]) C- v }4 v b. t.start();
2 h9 b1 C" k' f5 I% ? c. rt.start();* U- b8 e% L5 R- |
d. rt.start(1);2 U# u. Q' Z- o8 ^3 ]/ \7 P
52. d; P# L' s a1 E+ a) x% q* A
53. d' W: O3 n+ A: ]6 Q
54. ab |