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 do you mean by append?
What is meant by method?
How to run a JAR file through command prompt?
What is identifier give example?
State two differences between C and Java.
Can a class be defined inside an interface?
Explain the difference between abstract classes and interfaces in java?
Convert Binary tree to linked list.
What is difference between this and super keyword?
When a byte datatype is used?
Can we create our own wrapper class in java?
What are the five major types of reference sources?
What value is a variable of the string type automatically initialized?
What is a variable analysis?
What is singleton class and how can we make a class singleton?