不明白为什么打出来的是
Thread-0-----50321
Thread-0-----50322
Thread-0-----50323
Thread-0-----50324
Thread-0-----50325
Thread-0-----50326
Thread-0-----50327public class TreadDemo4 {
  public static void main(String [] args)
  {
  SellTickets tt=new SellTickets();
  Thread t=new Thread(tt);
  t.start();
  while(true)
  {
  int i=0;
  if (i==100)
  {
  try {
t.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("main Thread is running"+i++);
  }
  }

  }
}
class  SellTickets implements Runnable
{    
public void run()
{   int i=0;
while(true)
{   
System.out.println(Thread.currentThread().getName()+"-----"+i++);

}

}
}