why Runnable interface is preferable than extending the
Thread class?
Answer Posted / myluvdeepu
if we extend thread then we can't extend other class.
but if we implement runnable interface we can implement as much interface as we can, there is no restriction.
thread call the run method automatically(if called with no-arg).but for runnable we need to call run method.
thread cause problem in multiple inheritance.
but runnable interface don't.
| Is This Answer Correct ? | 4 Yes | 9 No |
Post New Answer View All Answers
What is the file extension for java?
When will we prefer to use set and list in java and why?
What is threaded programming and when is it used? : Java thread
What is definition and declaration?
What restrictions are placed on method overriding?
What is string english?
What is unicode in java?
What is multi level inheritance in java?
What is visibility mode?
Explain the features of interfaces in java?
What is member in java?
What is autoboxing and unboxing?
What is the private method modifier?
Tell me a few examples of final classes defined in Java API?
Difference between throw and throws?