Re: what is the difference between start() and run() method , if no runnable interface is used , run method is overridden inside the thread.
Posted By:
Anonymous
Posted On:
Monday, April 28, 2003 03:26 AM
Hi Meenu,
The purpose of the start() method is to let the JVM know that the thread is ready to run. So, when we call t.start(), JVM automatically calls the run() method of the thread t. In threading, run() method of the thread should not be called directly.
what happens if we call run() directly?
In this case, the run method would be called just like any ordinary method NOT as the run() method in a Thread class. There wont be any compile time errors, but it wont be executed like a thread.
Hope this helps..........