class ThreadTest
{
public static void main(String[] args)
{
new Thread()
{
public void run()
{
for (int x=0;x<=40 ;x++ )
{
System.out.println(Thread.currentThread().getName()+"----"+x);
}
}
}.start();
for (int x=0;x<=40 ;x++ )
{
System.out.println(Thread.currentThread().getName()+"----"+x);
}
Thread t=new Thread()
{
public void run()
{
for (int x=0;x<=40 ;x++ )
{
System.out.println(Thread.currentThread().getName()+"----"+x);
}
}
};
t.start();
}
}
为什么t.start( ) ;要等他俩结束才运行 |
|