I have something like the following:
class t_thread extends Thread { public t_thread() { new Thread(this).start(); } @Override public void run() { // change some variables try { Thread.sleep(1000); } catch (InterruptedException e) {} } }
And I call it like:
t_thread t = new t_thread();
The problem is that, it runs once when it is created, sleeps, and never runs again. If I add a run() after sleep(1000), it works fine but eventually causes a Stack Overflow.
Does anyone know why it does not continue to run until I stop it?