What's the difference in using runnable and extends in threads?



What's the difference in using runnable and extends in threads?..

Answer / Shashwat Gupta

Extending the Thread class creates a new thread by subclassing it, and the subclass must override the run() method to define what the thread should do. Implementing the Runnable interface allows you to create a separate thread of execution without extending the Thread class. The Runnable object's run() method defines the work that needs to be done.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Windows Threads Interview Questions

Explain the reasons of rebooting the system?

1 Answers  


How do you kill a process using pid?

1 Answers  


Describe the actions taken by thread library to context switch between user level threads?

1 Answers  


How do you kill tasks?

1 Answers  


What is windows daemon?

1 Answers  


What is a p-thread?

1 Answers  


Which one is not needed for Multi-program enviornment? 1) virtual memory 2) security 3) time sharing 4) none of the above.

7 Answers   Siemens,


semaphore variable is different from ordinary variable by ?

2 Answers   Siemens,


Explain cannot copy (file name)- access is denied?

1 Answers  


What is thread safety? How do you achieve it?

1 Answers  


Too many times when I click on a sentence a caption comes on Grr a pop up blocker maybe blockiing--however I have pushed the turn off pop up blocker. This only happens on google it does not happen on att.net

1 Answers  


What are three ways in which a thread can enter the waiting state?

1 Answers  


Categories