Class MyThread extends Thread {
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
}
System.out.println("B");
}
public class {
public static void main(String[] args) { MyThread t = new MyThread(); t.run(); t.start(); System.out.println("A");}}输出结果为什么是BAB而不是BBA?
|
|