これは私が持っているコードです。コンストラクターの最後の行で Null Pointer Exception が発生しました (workerQueue[i] = new LinkedBlockingQueue(100);):
public class QueueThreadPool {
private BlockingQueue<String>[] workerQueue;
private Thread[] workerThreads;
private int numQueues;
private int numThreads;
public QueueThreadPool(int numThreads, int numQueues) {
this.numQueues = numQueues;
this.numThreads = numThreads;
for(int i=1; i<=numQueues; i++){
workerQueue[i] = new LinkedBlockingQueue<String>(100);
}
}
public static void main(String args[]){
System.out.println("Start...");
new QueueThreadPool(50, 11);
System.out.println("End...");
}
助けてください!ありがとう!!