package TestPackege;
class Test extends Thread
{
Test(String name)
{
super(name);
}
public void run()
{
for(int x=0;x<60;x++)
{
System.out.println((Thread.currentThread()==this)+"..."+this.getName()+"run"+x);
}
}
}
public class ThreadTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
Test t1=new Test("one");
Test t2=new Test("two");
t1.run();
t2.run();
for(int x=0;x<60;x++)
{
System.out.println("main"+x);
}
}
}
不知道为什么出错,求帮助 |