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
Give few examples of final classes defined in Java API?
Can you explain the cs option of java interpreter?
how to create multithreaded program? Explain different ways of using thread? : Java thread
What are computer functions?
What is the importance of static variable?
What are the Class Libraries ?
What is static in java?
What is procedure overloading?
Explain about instanceof operator in java?
What is the use of predicate in java 8?
Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?
Is string a datatype?
Does a class inherit the constructors of its superclass in java programming?
What is the difference between dom and sax parser in java?
Is age a discrete variable?