i agree wid Valentin , Thread
t2's parent is indeed
Thread main at line1 , when
t1 is created , it gets it priority from the parent
main Thread ( which happen to be 5 , NORM_PRIORITY ) , at line2
t1 explicitly change this priority to 3
AT line3 , a new thread
t2 is created , by passing a
Runnable( Thread class implements Runnable) to constructor ( NOTE dat Thread class donot hav ne constructor which take Thread as parameter , so there is no question of
t2 taking
t1's priority anyway ) , This new thread
t2 is created in main() method itself , so its parent is
main Thread ,(the Thread , in which instance of some other Thread is made using
new , is the parent of new Thread ) n it gets its priortiy 5 from main Thread only
so the line4 n line5 prints expected output as below :
3 5 hav chiliing prep n good luck !
------------------
Gagan (/^_^\)