Java??????????δ???????
???????????? ???????[ 2016/2/22 11:01:31 ] ??????????? ???????
?????????????????????????????????????????????????????Java????δ?????????????????????????????????????Java?е???ó????????????????????????????δ???????????δ????????????????????????
?????.Java?й?????ó??????????????
??????.Java????δ??????
??????.Java????δ???????
?????.Java?й?????ó??????????????
??????Java?У??????ó??????????JVM???????е?????JVM?????????????????????java.exe????javaw.exe??windows???????????????????????Java???????????????????????????????????????????????????????????????????????????????????????????????????????????????????JVM????????????JVM???????????????????????????????????????????????????
????????Java?????????????????????????UI??????????????????????????н??У??????????????????UI????????????UI???????????????????????????
??????.Java????δ??????
??????java??????????????????????????????1?????Thread??2?????Runnable????
????1.???Thread??
???????Thread????????????дrun????????run?????ж????????е?????
????class MyThread extends Thread{
????private static int num = 0;
????public MyThread(){
????num++;
????}
????@Override
????public void run() {
????System.out.println("???????????"+num+"?????");
????}
????}
???????????????????????????????????????????????start()??????????????????????run()???????????run?????????????????е????????????run????????????????????????run????????????????????????κ????????????????????μ????????ж????????
public class Test {
public static void main(String[] args) {
MyThread thread = new MyThread();
thread.start();
}
}
class MyThread extends Thread{
private static int num = 0;
public MyThread(){
num++;
}
@Override
public void run() {
System.out.println("???????????"+num+"?????");
}
}
??????????????У????????start()??????????????μ?????????????start()???????ú?run()???????????????????????????
public class Test {
public static void main(String[] args) {
System.out.println("?????ID:"+Thread.currentThread().getId());
MyThread thread1 = new MyThread("thread1");
thread1.start();
MyThread thread2 = new MyThread("thread2");
thread2.run();
}
}
class MyThread extends Thread{
private String name;
public MyThread(String name){
this.name = name;
}
@Override
public void run() {
System.out.println("name:"+name+" ?????ID:"+Thread.currentThread().getId());
}
}
???????н????
??????
???·???
??????????????????
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