I'm studying competition, and I was trying to make a code using semaphore , and this error occurred
"the type of ProcessorThread (int, Semaphore) is erroneous"
When I tried to run.
I'm using NetBeansIDE, and I wonder what this error is.
Class where error occurs:
package threadsemaforo;
import java.util.concurrent.Semaphore;
public class ThreadSemaforo {
public static void main(String[] args) {
int numeroDePermicoes = 2;
int numeroDeProcessos = 6;
Semaphore semaphore = new Semaphore(numeroDePermicoes);
ProcessadorThread[] processos = new ProcessadorThread[numeroDeProcessos];
for (int i = 0; i < numeroDeProcessos; i++) {
**processos[i] = new ProcessadorThread(i, semaphore);**
processos[i].start();
}
}
}