- public class ThreadTest {
- public static void main(String args[]) {
- MyThread t = new MyThread();
- t.run();
- t.start();
- System.out.println("A");
- }
- }
- class MyThread extends Thread {
- public void run() {
- try {
- Thread.sleep(3000);
- } catch (InterruptedException e) {
- }
- System.out.println("B");
- }
- }
复制代码 这段代码的输出为什么是BAB? |