se alguem poder me ajudar eu agradeço muito.
esta dando um erro, e já tentei mudar nome da variavel, tirar o modificador de acesso e nada adiantou...
public class minithread extends Thread {
public minithread(String name){
super(name);
}
private int sleepTime=0;//o erro esta ocorrendo nessa linha
tempo=(int)(Math.random()*5000);
public void run(){
try{
System.err.println(getName() + "going to sleep");
Thread.sleep(sleepTime );
}
catch ( InterruptedException exception ) {
System.err.println( exception.toString() );
}
System.err.println( getName() + " done sleeping" );
}
}
public class ExercicioCasa {
public static void main(String[] args) {
Thread thread1= new Thread("1");
Thread thread2= new Thread("2");
Thread thread3= new Thread("3");
Thread thread4= new Thread("4");
thread1.start();
thread2.start();
thread3.start();
thread4.start();
System.err.println("estudo de THREADs");
}