aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes join() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "join() method" Watch "join() method" New topic
Author

join() method

Swati Gupta
Ranch Hand

Joined: May 28, 2002
Posts: 106
If we use the join() method with some time argument or the sleep() method with the same time argument in the main thread ,the behaviour of main thread will remain the same?
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
No. If you provide a time argument to the join method, that thread will wait for another thread to complete executing or until the time expires, whichever comes first. Assuming the thread is not interrupted, calling Thread.sleep() will cause a thread to stop executing for the number of milliseconds supplied.
Corey


SCJP Tipline, etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: join() method
 
Similar Threads
join()
Salient join() characteristics
Thread once again (Join)
how it works---join(),thread class.
Join method