This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes join() method of thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "join() method of thread" Watch "join() method of thread" New topic

join() method of thread

Mohan Ramanna
Ranch Hand

Joined: Jun 26, 2000
Posts: 36
can someone throw liht on the join () method of thread.
a clear explanation is expected?
thanks in advance
- mohan
Prasanna Joshi

Joined: Apr 25, 2000
Posts: 11
In javadoc --
Waits for this thread to die.
Practically a use of join is to block until the thread
completes it operation ie if u start a thread in main()
and u want the main to block until the thread completes
it can use join,so when the thread completes
it run ie dies,it unblocks the execution of main()
eg public static void main(String [] args)
Thread t = new Thread();
I agree. Here's the link:
subject: join() method of thread
Similar Threads
join method
making a thread wait
Thread Joining and ExecutorService
How to wait until all threads finishes task?