first.start();
) d0 ~' b0 v p" U5 ~holt second = new holt('second'); ( q1 F6 O! L R1 E# _1 [2 `8 P. E- B
second.start();
/ f z; M& Z& X1 m, @3 W2 Q2 L} 0 \+ i. z2 S! Y* J& @
public void start(){
+ O% P, L# R: N3 Nfor(int i = 0; i %26lt; 2; i ++){
1 [+ Z4 D- P1 S/ I( ]4 j! msystem.out.println(getthreadname() +i);
+ s! q6 X4 k/ y! W4 X& Qtry{ 9 k! Y5 Z) j. c. S8 s' Z
thread.sleep(100); " O% J* i" R9 f) n% z5 C
} catch(interruptedexception e){system.out.println(e.getmessage());} - Y. f. w- P9 w$ }- V. A/ n3 b
}
: U! k9 F6 f) K! p; I) F6 n% I}
6 N$ J8 c$ r! X9 W" H; Z8 `: w} </p>/ ]/ x6 v2 A: r# F! z7 s) x. @2 }
1) compile time error
8 c T' U) S" ]2) output of first0, second0, first0, second1 9 W _6 q$ _5 x9 H
3) output of first0, first1, second0, second1 / J( ~) {4 m) e+ U% b" z, { L- D; P
4) runtime error 1 J& j& f; s+ G \+ Z: w
answer to question 31 + |5 P# R% j' _8 Q1 e, ?: z: O2 b# [
-------------------------------------------------------------------------------- ; O+ B; M; C# l5 l8 P6 P% v' y: J2 ]
question 32) ) I* @/ ~- I2 I4 I# F" b2 c! t5 h
an applet has its layout manager set to the default of flowlayout. what code would be correct to change to another layout manager.
; @$ n% {2 z- B8 i& e( W1) setlayoutmanager(new gridlayout()); ' h3 c2 p$ z, v$ }1 W3 Y# g, E
2) setlayout(new gridlayout(2,2)); 9 |0 y" B* ~+ J% U# m- h
3) setgridlayout(2,2); * j [' l C9 Z6 a& J
4) setborderlayout();
4 c+ l: z* g. e4 P' i( ]answer to question 32 7 o. u q: p6 Q0 a" B s. j: d
--------------------------------------------------------------------------------
& i3 ~! E" w% o; H1 cquestion 33)
( r! }0 m$ i H' dwhat will happen when you attempt to compile and run the following code?.
/ M0 ~6 i4 Q7 N( X# eclass background implements runnable{
, r6 l% C7 |) g0 [int i=0; 1 G; S' F3 v( O. C1 @5 w' U$ f
public int run(){
0 q5 s+ M, o! g& \2 Zwhile(true){ |