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

Have you used threads in Servelet?

1 Answers   Satyam,


Which container method is used to cause a container to be laid out and redisplayed?

1 Answers  


What is a convertor?

1 Answers   Suzlon,


Tell me about Firewalls in RMI?

0 Answers  


In howmany ways a thread can be created?

3 Answers   HCL,


how the action can be map from jsp page to bean class in mvc1

1 Answers   Photon,


function of extends and implements keywords?

2 Answers  


Why are some of the class and element names counter-intuitive?

1 Answers  


Explain the steps in details to load the server object dynamically?

1 Answers  


difference between applicationserver and webserver

4 Answers   SolutionNET,


What are the benefits of detached objects?

1 Answers  


What is a modular application?

1 Answers  


Categories