class ThreadDemo{
public static void main(String[] args) {
Thread1 a = new Thread1();
a.start();
for (int i=0;i<50;i++ ) {
System.out.println("main......");
}
}
}
class Thread1 extends Thread {
public void run(){
for (int i=0;i<60;i++ ) {
System.out.println("Thread.....");
}
}
}为什么我打印都是先打印主函数,然后是Thread。。。。没出现穿插情况 |
|