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 / praveen gupta

The main reason to implement Runnable interface is that you know that java does not supporting multiple inheritance
through classes .if u extend Thread class,u can't extend any
class which you required other than thread class.if u are
implementing runnable interface u can extend any class which
you required other than thread class.this is main advantage of
implementing java.lang.Runnable interface.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to disable caching on back button of the browser?

1003


How does predicate work in java?

933


Why are the objects immutable in java?

935


Is array synchronized in java?

992


Which is better arraylist or vector?

973


what is ststic with example

1997


What is the difference between an interface and an abstract class?

945


Explain list interface?

907


What is the basic concepts of OOPS?

1128


Why do I need to declare the type of a variable in java?

990


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

1241


Give us the name of the list layoutmanagers in java?

874


What are the super most classes for all the streams?

2391


What are exception handling keywords in java?

973


What are the states of thread in java?

917