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


Please Help Members By Posting Answers For Below Questions

What do you mean by append?

530


What is meant by method?

575


How to run a JAR file through command prompt?

712


What is identifier give example?

549


State two differences between C and Java.

689






Can a class be defined inside an interface?

559


Explain the difference between abstract classes and interfaces in java?

596


Convert Binary tree to linked list.

586


What is difference between this and super keyword?

512


When a byte datatype is used?

561


Can we create our own wrapper class in java?

539


What are the five major types of reference sources?

532


What value is a variable of the string type automatically initialized?

609


What is a variable analysis?

634


What is singleton class and how can we make a class singleton?

659