1.you have make t1 as Daemon Thread
u not make it...for after u have run it ..if it is finished .it will seem to be dead
2. You have join the t1 to main
u not write it ..the run() will never to run
3.You have to suspend the main when the thread starts and resume it after
the value of 'j' is set to 100
if u not do it,and just do
public void run() {
j=100;
}
it will OK
4.You have to interrupt the main thread
????it is fun
u not make it...for after u have run it ..if it is finished .it will seem to be dead
2. You have join the t1 to main
u not write it ..the run() will never to run
3.You have to suspend the main when the thread starts and resume it after
the value of 'j' is set to 100
if u not do it,and just do
public void run() {
j=100;
}
it will OK
4.You have to interrupt the main thread
????it is fun
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货