File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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
It's not a secret anymore!