Implement Runnable. You should only extend thread if you are adding more functionality to it, or attempting to change the way it behaves. Most of the time you are just trying to get code to run in a thread, not change how the Thread works. That is what the Runnable is for.
Theory aside, the Runnable also gives you more flexibility at lower cost. You can use Runnables with Executors in the java.util.concurrent package, and in Thread pools available from many sources. And you don't get any of the overhead that a Thread has when implementing it.
Joined: Mar 28, 2007
Thanks for the reply!!!
subject: Implementing Runnable or Extending Thread class