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

What is more advisable to create a thread, by implementing
a Runnable interface or by extending Thread class?

Answer Posted / devarathnam c,kotagudibanda(po

Hi...To create a Thread ,implement the Runnable interface
it is more advisable than extending a Thread class.By
extending the Thread class u can't achieve the multiple
inheritance.So implementing the Runnable interface is good
programming practice.

public class ThreadTest extends Thread,Applet
//This is illegal

public class ThreadTest extends Applet implements Runnable
//This is legal.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the pillars of java?

873


What is the difference between procedural and object-oriented programs?

937


Does isempty check for null?

962


What is class??

1180


What is hash table in java?

953


What is one third plus one third as a fraction?

879


What is the use of StringTokenizer class?

1027


Does java runtime require a license?

992


What are the restrictions imposed on method overriding?

969


Why is java called the platform independent programming language?

961


What are the rules for variable declaration?

914


How do you define a method?

936


What is bubble sort in java?

1007


How do you write a scanner class in java?

964


How do you create a bulleted list?

1210