In howmany ways a thread can be created?

Answers were Sorted based on User's Feedback



In howmany ways a thread can be created?..

Answer / harish

There are two different ways to create a Thread. One is
extends Thread class and implement Runnable Interface.
Better to go for Runnable interface. It will have a method
run(). You should override in the sub class. Even, you
can extend another class to the same thread class.

Is This Answer Correct ?    3 Yes 0 No

In howmany ways a thread can be created?..

Answer / rajshekhar

There are 2 ways to create a thread
1.By extending thread class
2.and the second one is by implementing runnable
interface.among the two the second one is more common and
better to use.

Is This Answer Correct ?    3 Yes 1 No

In howmany ways a thread can be created?..

Answer / ranganathkini

1. Extending the Thread class
2. Implementing Runnable interface in a class and then
passing its reference to a new Thread.
3. Creating an anonymous class to extend the Thread class.
4. Creating an anonymous class to implement the Runnable
interface and then passing its reference to a new Thread.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Advanced Java Interview Questions

What is the argument type of a programs main() method?

0 Answers  


if i know the lenght of collection in hand, should I use Array or Arraylist? justify

1 Answers   iTrust,


what is the use of State Factories?

0 Answers  


What is the difference between java class and bean?

0 Answers  


Why does the option tag render selected=selected instead of just selected?

0 Answers  






what is the use of Object Factories?

1 Answers  


Does Java pass arguments by value or reference?

5 Answers   HeadStrong,


How many times may an objects finalize() method be invoked by the garbage collector?

0 Answers  


what is the port number of RMI?

2 Answers  


What is the difference between RMI registry and OS Agent?

0 Answers  


Describe responsibilities of Activator?

0 Answers  


What is JNI?

1 Answers   Google, TCS,


Categories