first.start(); - B$ f1 b; b+ F9 P9 V
holt second = new holt('second');
1 `! @! O9 B1 \ F/ h2 b: N1 ssecond.start();
, {# f- `- W" R" Y3 q/ l1 ~} $ l1 V W& T: G/ \6 K
public void start(){
4 ~) p; v: s) C" p( h8 o5 G: Mfor(int i = 0; i %26lt; 2; i ++){ P% b/ {. N% t4 J& Q v: b7 C
system.out.println(getthreadname() +i);
0 B* {; x9 |4 I5 U0 h- {try{ $ z/ P5 q( Q8 w/ Y; B3 Z' }9 k$ o
thread.sleep(100);
5 Q H- R/ k8 o( r' a w} catch(interruptedexception e){system.out.println(e.getmessage());}
6 r) v% h0 |# I+ R8 o}
/ ]$ x9 E3 Y! ^7 k* K! U} ( n; h( y( e9 A/ J. H
} </p>
5 q6 `7 W+ |* S1) compile time error
9 C% \' w: C H' t2 E' _# U% `' j* O2) output of first0, second0, first0, second1
2 U# `$ U6 n# ]4 R8 j* `, j& ]3) output of first0, first1, second0, second1
, }' n1 N# W. }' s4) runtime error " v1 e7 E0 |* }* e A
answer to question 31
* R& A/ o- Q; g8 d5 x% M-------------------------------------------------------------------------------- # P; a; H" A5 Q- \, X- A, V6 M s
question 32)
% ?% a3 d& w5 C' Q# {- e" \an applet has its layout manager set to the default of flowlayout. what code would be correct to change to another layout manager. , p2 n7 u" w, _& B9 U
1) setlayoutmanager(new gridlayout());
4 r0 s: c q& C [# Z f# s2) setlayout(new gridlayout(2,2)); 1 s$ b& f' p1 M+ b* y
3) setgridlayout(2,2);
4 |; [8 d6 i1 E" d4 f/ W6 o2 [, ^4) setborderlayout(); w% j3 k5 o0 D9 j1 }$ n, b: u1 S
answer to question 32
8 Q# _/ B! Z7 C; I' B# d9 @-------------------------------------------------------------------------------- / F: Y) B2 B4 ~4 R* g4 B
question 33)
] |) |$ S6 |- hwhat will happen when you attempt to compile and run the following code?. & e8 e* H1 T9 B6 p! W& T* ?
class background implements runnable{ " a1 ^4 N/ C; G$ Q6 X7 H
int i=0;
% C) d" t% e! P3 x5 r6 Z% R3 tpublic int run(){ ! c* ^$ R) E2 Y
while(true){ |