What are the various ways of creating a thread. What is difference between them

Showing Answers 1 - 2 of 2 Answers

gyanesh

  • Jul 20th, 2005
 

The thread can be created either by extending the Thread class or implement the Runnable interface.

  Was this answer useful?  Yes

theJavaGuy

  • Jan 30th, 2010
 

Two ways-

1. By extending Thread class
2. By implementing Runnable interface

We extend the thread class when we are creating a new thread to assign a specific type of job to that thread. But if we want to create a thread which does not do a specific type of job, instead does the job which is quite similar to already running threads, then we implement runnable interface.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions