In howmany ways a thread can be created?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!

1369


Why do threads block on i/o?

686


What are the design considerations while making a choice between using interface and abstract class?

543


What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?

574


wahts is mean by dynavalidatorform in struts/

1571






What happens when a thread cannot acquire a lock on an object?

542


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

674


hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me

1785


Difference between DurableSubscription and non- DurableSubscription?

1716


What is jboss?

574


What is the difference between the ‘font’ and ‘fontmetrics’ class?

641


How can I avoid validating a form before data is entered?

554


How to determine SGA site?

1912


What is the immediate superclass of the applet class?

605


How would you reatach detached objects to a session when the same object has already been loaded into the session?

685