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?

Answers were Sorted based on User's Feedback



What is more advisable to create a thread, by implementing a Runnable interface or by extending Th..

Answer / bindhu solomon

Creating a thread using implementing Runnable interface
are more advisable. Suppose we are creating a thread by
extending a thread class, we cannot extend any other class.
If we create a thread by implementing Runnable interface,
we can extend another class.

Is This Answer Correct ?    6 Yes 0 No

What is more advisable to create a thread, by implementing a Runnable interface or by extending Th..

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

What is more advisable to create a thread, by implementing a Runnable interface or by extending Th..

Answer / abcd

Suppose ..you want to work with thread and also with a
class from AWT package.

java rule is that : YOu cannot extend more one class in
your program.

So it is adviseable to implement the runnable interface and
extend any other class which you desire....

Is This Answer Correct ?    1 Yes 0 No

What is more advisable to create a thread, by implementing a Runnable interface or by extending Th..

Answer / harish

When u extend a Thread each of your thread has a unique
object associated with it,where as with Runnable interface
may threads share the same object instance.

Is This Answer Correct ?    1 Yes 0 No

What is more advisable to create a thread, by implementing a Runnable interface or by extending Th..

Answer / ravikiran

by implementing runnable interface

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Does A Class Inherit The Constructors Of Its Superclass?

0 Answers   Wipro,


give an example for encapsulation?

0 Answers   Aspire,


Can we declare the static variables and methods in an abstract class?

0 Answers  


What is singleton class?

16 Answers   3i Infotech, 7 Seas, ABC, Amdocs, Cap Gemini, Oracle, Persistent, TCS, Techforza,


What is the access scope of a protected method?

0 Answers  


How many arguments can be passed to main ()?

0 Answers  


Give some features of interface?

0 Answers  


What is a generic type?

0 Answers  


What is meant by 'bit masking' in java?

0 Answers   DELL,


How do we make a class serialize?

3 Answers   Syntel,


What happens to a static var that is defined within a method of a class?

0 Answers  


What is garbage collection in Java, and how can it be used ?

32 Answers   Accenture, HCL, Infosys, Sara, SITS, TCS, Wipro,


Categories