Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Give few examples of final classes defined in Java API?

1282


Can you explain the cs option of java interpreter?

992


how to create multithreaded program? Explain different ways of using thread? : Java thread

1054


What are computer functions?

997


What is the importance of static variable?

1169


What are the Class Libraries ?

1088


What is static in java?

1165


What is procedure overloading?

2367


Explain about instanceof operator in java?

1121


What is the use of predicate in java 8?

1016


Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?

1035


Is string a datatype?

1037


Does a class inherit the constructors of its superclass in java programming?

1212


What is the difference between dom and sax parser in java?

1027


Is age a discrete variable?

1037