aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "join() method of thread" Watch "join() method of thread" New topic
Author

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
Greenhorn

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 operation.you 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();
t.start();
t.join();
}
}
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: join() method of thread