To make an object to begin executing as a separate thread,
what method is used?

Answers were Sorted based on User's Feedback



To make an object to begin executing as a separate thread, what method is used?..

Answer / anonymous

Public void run() ---- method should be used.

myClass mc= new myClass();
Thread t1= new Thread(mc);

thatClass tc= new thatClass();
Thread t2= new Thread(tc);

t1.run();
t2.run();



Two Objects
Two Threads

Is This Answer Correct ?    1 Yes 0 No

To make an object to begin executing as a separate thread, what method is used?..

Answer / devarathnam c,kotagudibanda(po

Hi...
public void run();method in Runnable interface,which only
one method in Runnable interface.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

Should synchronization primitives be used on bean methods?

0 Answers  


what is handle?

0 Answers  


Explain the different types of memory used by jvm?

0 Answers  


1) which method of the RequestDispatcher cannot be called once the output is sent to the client? a. forward b. include c. both a&b 2) which interface should an object implement to get notified of changes to the list of active sessions in a web application? a. HttpSessionListener b. HttpSessionActivationListener c. HttpSessionAttributeLIstener 3) A user can select multiple locations from a list box on an HTML form, which of the following methods can be used to retrieve all the selected location? a. getParameter() b. getParameterValues() c. getParamValues() 4) which of the following methods should be used to send character text to the client? a. ServletResponse.getWriter() b. ServletResponse.getOutputStream() c. ServletResponse.getOut() 5) which implicit object is always available in a JSP page? a. exception b. session c. out 6) which inclusion mechanism doesn't include the source of the page, rather the output of the page. a. include directive b. jsp:include action c. Bothe a& b 7) which attribute of the page controls whether a page participates in session or not? a. session-allowed b. session c. isSession

1 Answers  


What are the types of scaling?

0 Answers  






How many ways can a thread be used?

4 Answers   Sun Microsystems,


Why use a datasource when you can directly specify a connection details?

0 Answers  


AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?

0 Answers  


What is the immediate superclass of the applet class?

0 Answers  


Why doesn’t the focus feature on the tag work in every circumstance?

0 Answers  


What is the relation between the infobus and rmi?

0 Answers  


JMS based on what technology?

1 Answers  


Categories