??????????java????????
???????????? ???????[ 2013/5/10 9:56:52 ] ????????
???????????????????????????????????????????????????????е????????????????????????????????
import java.util.concurrent.TimeUnit;
public class Test {
public static void main(String[] args){
//??????????????????????????main???????????
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
Thread myThread=new Thread(new Runnable(){
public void run(){
while(true)
{
System.out.println("i will wait for you in shangling");
try {
TimeUnit.MILLISECONDS.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
});
myThread.setDaemon(true); //???ú?????????д??start()????????棬????????Ч??
myThread.setPriority(Thread.MAX_PRIORITY);
myThread.start();
Thread userThread = new Thread(new Runnable(){
public void run(){
for(int i=0;i<5;i++)
System.out.println("this is a user Thread");
}
});
userThread.setPriority(Thread.MAX_PRIORITY);
userThread.start();
System.out.println("the main thread is end" );
}
}
??????????????????????????????????????????????????????????????????????????????е???????????????????????????????ú???????еt???????????????????????????????????????????main?????????????sleep?????????????????
??????????????????????sleep??????????????????????????????????????????????????????????????????????????????????????????????????鷢????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11