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 is the function of java?

949


Which is easier .net or java?

1023


What is the difference between heap and stack memory?

1134


Variables used in a switch statement can be used with which datatypes?

930


What are the two categories of data types in the java programming language?

917


When should I use singleton pattern?

978


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

1241


What is multiple inheritance? Is it supported by java?

914


What is close method? How it's different from Finalize & Dispose?

998


How do you execute a thread in java?

902


What is boolean false?

928


Define inheritance with reference to java.

1026


Can we increase size of array?

971


How is it possible for two string objects with identical values not to be equal under the == operator?

922


Can we override the static methods?

975