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
How does a for loop work?
Is array dynamic in java?
How infinite loop is declared?
What does substring mean?
What are the methods available in a class?
What is character in data type?
What is the difference between a window and a frame in java programming?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What is included in core java?
What is the relationship between class and object?
Why do we declare a class static?
How do I type unicode?
What is the use of isempty in java?
What is the difference between actual and formal parameters?
What is the difference between import java.util.date and java .util?