Google News
logo
Java Multithreading - Interview Questions
Thread vs Runnable which is better approach to create a thread?
Implementing Runnable interface is considered to be better approach than Extending Thread due to following reasons.

* Java does not support multiple inheritance so if you extend Thread class and you can not extend any other class which is needed in most of the cases.
* Runnable interface represents a task and this can be executed with help of Thread class or Executors.
* When you use inheritance, it is because you want to extend some properties of parent, modify or improve class behavior. But if you are extending thread class just to create thread, so it may not be recommended behavior for Object Oriented Programming.
Advertisement