This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
First you have to create a class that either extends Thread or implements Runnable interface. Then overwrite the run method. Once you have done this you can refer to the Java API for Thread start(). The start method creates a new thread and executes this.run().
i have seen peoples saying that start will call the run method and yes that is correct but partially
main things is that.
Start will create a new thread and that thread after initializing itself call run method.
Internal implementation of run method,
Runnable is a interface so it doesnot contain implementation of run method.So any class which implements this interface must have to provide a implementation of run method.
It is class which simply implements a run method but doesnot do anything with it..
see below code