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();
}
}
程序怎么执行,为什么
|
|