下面这段程序执行的结果为什么是"MyThread running"、"Thread Test"、"MyThread running",而不是"MyThread running"、"MyThread running"、"Thread Test"。求解释:
class MyThread extends Thread{
public void run(){
try {
Thread.currentThread().sleep(3000);
} catch (InterruptedException e) {
}
System.out.println("MyThread running");
}
}
public class ThreadTest{
public static void main(String argv[]) {
MyThread t = new MyThread();
t.run();
t.start();
System.out.println("Thread Test");
}
}
|
|