I'm trying to run a Thread
class every second. I cant use Runnable
. I tried in the following way, but its throwing StackOverflowException
. Can anyone please let me know a standard method to make a thread class run every second.
public class A extends Thread {
public void run() {
//do my stuff
sleep(1*1000,0);
run();
}
}