中国开发网: 论坛: 程序员情感CBD: 贴子 379987
老玉米
class TestRunner
package bjepb.unittest;

import bjepb.promng.Management;

public class TestRunner {

public static void main(String[] args) {

ThreadGroup threadgroup = new ThreadGroup("GroupChild");

for (int i=0; i<10; i++)
{
Thread thread = new Thread(threadgroup,new TestEmployee());
thread.setName("wy-".concat(Integer.toString(i+1)));
thread.start();
}
while (threadgroup.activeCount() != 1)
{
//System.out.println("activeCount " + Integer.toString(threadgroup.activeCount()));
try{
Thread.sleep(2000);
}
catch (Exception e){
e.printStackTrace();
}
}

Management.getManagement().PrintEmployees();

}
}

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录