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...

We have two methods to create methods the threads.
1. Implementing runnable interface
2. Extending to thread class and overriding run method.
Among these two which one is better and why?
Please explain me in detail.

Answer Posted / venkat

implementing runnable interface is better than extending to
thread why because if u implements from runnable interface u
can have chance to extend one more class.but incase of
extending thread this facility is not there

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can list have duplicates in java?

955


Does .length start 0 java?

1059


What is meant by class loader? How many types are there?

1323


What is the dot operator?

1061


Is arraylist ordered?

1118


Is 0 true or false?

1046


How to check if a list is sorted in java?

1085


How do I print a “?

1046


How do you calculate roots in java?

1154


What does file separator do in java?

1073


What all access modifiers are allowed for top class ?

1240


Can we use string in the switch case?

1092


What is meant by 'bit masking' in java?

1255


How does regex work?

1013


What are the ways in which a thread can enter the waiting state?

990