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 / srinu

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 ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will happen to the exception object after exception handling?

991


What is string immutability?

1098


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

975


What is module in oop?

1008


Can I uninstall java?

1042


Write a program to solve producer consumer problem in java?

1006


How many wrapper classes are there in java?

1012


Why webdriver is an interface?

1048


Is java platform independent?

970


Is java ee a framework?

978


What are static variables and functions?

1137


Is list thread safe in java?

917


What is binary search in java?

985


What is jit and its use?

984


what do you mean by marker interface in java?

977