原理上不分先后,但系统实现上肯定是第二个。
因为thread.start()后马上就输出了第二行,而thread.start只是通知操作系统启动另外一个线程甚至进程,肯定要多花一些时间才等到线程真正启动。

解决方案 »

  1.   

    因为thread.start()后马上就执行下面的 System.out.println("这是main()里面的内容");
      

  2.   

    原理上是两种结果都是可能的。因为两个优先级相同的线程那个抢占快那个就先输出。现在这里是Main线程已经启动了,而另外一个才刚启动
      

  3.   

    为什么要用
    Runnable r1=new Xing();
    Thread t1=new Thread(r1);
    用 Thread t1=new Thread(this,"thread"); 取代行不行?
      

  4.   

    奇怪,怎么我用 
         Thread t1=new Thread(this,"thread"); 
    程序报错:Xing.java:9: non-static variable this cannot be referenced from a static context        Thread t2=new Thread(this,"thread");
                                 ^
    1 error请告诉我为什么?
      

  5.   

    楼上的,你语法本身有问题吧~~问题,我想答案出来了。
    现在这里是Main()本身是一个线程,而程序中这个线城最先启动了,而另外一个再后面才启动的