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

What is integers and example?

0 Answers  


What is the covariant return type?

0 Answers  


Is java pass by value or pass by reference?

0 Answers  


Why java does not supports multiple inheritance?

3 Answers   TCS, VSoft,


Why synchronization is important in java?

0 Answers  


whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net

0 Answers  


Can an object subclass another object?

0 Answers  


What is cr keyboard?

0 Answers  


why we write public static void main (String args[]) in core java plz explain briefly??????????????????

3 Answers   HCL,


What is deserialization and how do we do deserialization?

3 Answers   Synechron,


What do you know about the garbage collector?

0 Answers  


What is the use of 'super' keyword inside a constructor?

0 Answers   Flextronics, Thomson Reuters, Virtusa,


Categories