class  MyThread  extends Thread
{   
  public void run()
  {   
      for(int i=0;i<1000;i++)
       {   
         System.out.println("Print   "+i);   
      }   
  }   
}
   
class testing
{   
  public static void main(String   []args)   
  {   
      new   MyThread().start();   
      System.out.println(Thread.currentThread().getName()); 
      System.exit(0);       
       System.out.println("Main() exits");  
  }   
}  

解决方案 »

  1.   

    优先级相同的线程,谁先抢到cpu资源谁先执行
      

  2.   

    应该是主线程先吧 ,
    主线程会去执行main方法,而 new   MyThread().start();   
    这句代码是在main()方法里的,
      

  3.   

    main 当然在运行了,因为是他启动了线程,启动之后。 就不好说了。如楼上几位说的,谁抢到了CPU,谁就执行哦。否则还叫多线程干嘛!!