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 language is java written?

1010


Is null a keyword in java?

969


What is OOP Language?

1069


What is difference between c++ and java ?

1120


Define canvas?

974


How do you use equal in java?

1070


What is the difference between inheritance and encapsulation?

1142


Which variable is the independent variable?

975


Difference between static binding and dynamic binding?

1102


What is the significance of listiterator?

1094


What are the new features in java 8?

1015


Which methods cannot be overridden in java?

984


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

997


What is the difference between the direct buffer and non-direct buffer in java?

1025


Is there a way to increase the size of an array after its declaration?

1041