Posts Tagged ‘ thread ’

Story behind start() and run() methods of Java Thread

Nov 27th, 2009 | By admin | Category: Java

The basic concept of creating a java thread is to extend the class java.lang.Thread or to implement java.lang.Runnable interface. In both the cases , implementation of run() method is mandatory for your thread to be a meaningful Thread.

The run() method is the most important method in the thread classes, it is also the only method that we need to implement in both cases. Why it’s only proper to call the start() method to start the thread instead of calling the run() method directly? What are the problems if we do so ?

Click below to have a look at the detail explanation.