大家看看这段代码,你们有没有这样的错误:
public class ThreadPool {
WorkerThread[] pool;
public void newWorker(int threadnum) {
pool = new WorkerThread[threadnum];//自己写的线程类
}
public void start() {
for (int i = 0; i < pool.length; i++) {
new Thread(pool[i]).start();
}
}
}
这段代码能运行起来吗