What is the 2 way of creating a thread ? Which is the best way and why?

What is the 2 way of creating a thread ? Which is the best way and why?

Two way of creating the thread in java are: * Extending the Thread class * Implementing the Runnable Interface.Both ways provides the same functionality.

 But itis better to implement the Runnable interface, because if you extends the Thread class you willnot be able to extend any other class. One classcan extends only a single class but can implements many interfaces.


By:Jalees
Date:2012-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher