the type of "OBJECT" is erroneuos

Asked

Viewed 33 times

2

I’m studying competition, and I was trying to make a code using the Semaphore, and that mistake has arisen

"the type of Processadorthread(int, Semaphore) is erroneuos"

when I tried to run.

I’m using Netbeanside, and I’d like to know what this mistake 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();
    }   

    }

}
  • 1

    Enter the code of the constructors of the class ProcessadorThread.

  • found the problem, was missing I implement one more class! now I managed

  • 1

    @renanmateus please set the solution as a response and mark it as resolved. Others may benefit from this response.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.