- <P>public class test1 {
- public static void main(String[] args){
- new Thread1().start();
- for(int i=0;i<10;i++){
- System.out.println("main");
- }
- }
- }
- class Thread1 extends Thread{
- public void run(){
- for(int i=0;i<10;i++){
- System.out.println("thread");
- }
- }
- }</P>
复制代码 输出结果是:
main
main
main
main
main
main
main
main
main
main
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
为什么不是间隔出现呢,书上的输出是main和thread间隔出现啊
|