日期:2014-05-20 浏览次数:20901 次
public class TestThread extends Thread
{
public TestThread(String name){
super(name);
}
public void run(){
for(int i=0;i<5;i++)
{
System.out.println(this.getName()+":"+i);
}
}
public static void main(String[] args){
Thread t1 = new TestThread("aaaaa");
Thread t2 = new TestThread("bbbbb");
t1.start();
t2.start();
}
}