Runnable Interface

Why we are using by implementing the runnable interface rather than we have the run() method in Thread class?

Questions by sailendra.n.jena   answers by sailendra.n.jena

Showing Answers 1 - 3 of 3 Answers

pdommara

  • Sep 28th, 2010
 

Hi,

Is the question  : Why we are going to Runnable interface  when you have Thread class ?.  Then every java  basic developer  should know that  " Java  does not suport  Mulptiple  Inheratance". 

We have one more difference is :

It is optional to have run method when your class extends Thread Class. Bcas Thread class has default implementaion of the run method .... Check it out.   :-)

and one more thing is Even Thread class implements Runnable interface .....surprised :-) ...Check it  out it's api.

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