</p> public string getthreadname(){
: c0 C- I6 `; m' X9 k( D return sthreadname;
0 r+ l+ P& Z# e# T* S8 d }0 G3 x4 v& Z7 R; B. p
public void go(){3 ], n, C0 b) h' {0 Y; S$ e0 k
holt first = new holt('first');
* O. j* k! [7 L! a+ ? first.start(); , \( `/ X+ _' p# Q+ R' x
# M# M2 u' e7 n. K# X- G9 q1 a
holt second = new holt('second');
* S o7 O, G9 y second.start();( Z' r3 [& N" K' k+ K
}
0 g/ ^8 A3 k' v4 N, |. z- `( D public void start(){
1 q _/ ?. _" w; k! z for(int i = 0; i %26lt; 2; i ++){0 F2 x0 B! t8 `
system.out.println(getthreadname() +i);
4 M6 e: b4 p" a7 | try{
7 T8 X! [2 |+ f2 i thread.sleep(100);
# C0 w+ |; B+ l! @4 d } catch(interruptedexception e){system.out.println(e.getmessage());}1 V5 l* a7 c+ w
}
3 g* W/ x9 B& r6 F9 Z' R }
- t2 r N* a, i; D9 r }
. w8 |: _; y& m3 G! M 1) compile time error
i1 H4 y) V# |- h! Z% c 2) output of first0, second0, first0, second12 m: I$ m: L* X( j2 s! Z
3) output of first0, first1, second0, second1) j o) y0 }" u
4) runtime error" c1 g& l/ `2 m/ ]& n9 @: I
answer to question 31
! |. ~/ M% P) `6 H2 Q --------------------------------------------------------------------------------
4 O: @+ Y- O9 A question 32)
8 u: L% f- w9 Z' ^! u an applet has its layout manager set to the default of flowlayout. what code would be correct to change to another layout manager.
' @2 W. p9 r! c' k) ?/ D 1) setlayoutmanager(new gridlayout());: V7 G+ ]* O6 L2 i: q. l$ R
2) setlayout(new gridlayout(2,2));$ v3 {' Z7 Z( q
3) setgridlayout(2,2);$ ?: n) t( Q0 `; z* F0 ^3 g
4) setborderlayout(); |