??δ?????????java???
???????????? ???????[ 2014/10/10 11:06:15 ] ????????Java ???
????Java???????????object????????????????java.lang.Thread???????? ?????????·????java?д??????????
????Tread thread = new Thread();
??????и???????????????start()????:
????thread.start();
????????????????У??????????????д???д?????????÷??????????????
??????д??????????е??????????????????????Thread???????????????дrun?????????????????????????Runnable?????????????????彲?????????????
????????Thread??????
????????Thread???????????????дrun??????run???????????start()?????????С????????£?
????public class MyThread extends Thread {
????public void run(){
????System.out.println("MyThread running");
????}
????}
?????????????·????????????????Thread????
????MyThread myThread = new MyThread();
????myTread.start();
???????????????start?????????????????????????run???????????????????run???????????????cpu????????????run??????к??????????????MyThread running??
??????????????′??????Thread??????????
????Thread thread = new Thread(){
????public void run(){
????System.out.println("Thread Running");
????}
????};
????thread.start();
???????μ?????run????????????????????????????”Thread Running”??
???????Runnable???
??????????д?????д???????????????????java.lang.Runnable????????????????е??????????????á?????????????
????public class MyRunnable implements Runnable {
????public void run(){
????System.out.println("MyRunnable running");
????}
????}
?????????????????run()???????????Thread?????????д??? MyRunnable???????????????£?
????<span style="color: #ff0000;">Thread thread = new Thread(new MyRunnable());</span>
????thread.start();
??????????????????????????????Runnable????run???????????н???????”MyRunnable running”??
??????
???·???
??????????????????
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