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 are jee technologies?
What are different exception types exceptions available in java ?
What is the difference between member variables initialization and assignment in a constructor?
What is the equal sign?
What is an class?
What is meant by oops concept in java?
What is the difference between this() and super() in java?
Is java platform independent?
Tell us something about different types of casting?
Can we change the scope of the overridden method in the subclass?
Using callable statement how can you pass out parameters, explain with example?
What do you mean by JVM?
Should you use singleton pattern?
Is minecraft 1.15 out?
Can we inherit inner class?