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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "join()" Watch "join()" New topic
Author

join()

Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi guyz.I have not understand the function of join().A/C to me it waits to join the curently running thread to which it is joined.
If it is correct then plz. explain it
Bye.
Viki.
------------------
Count the flowers of ur garden,NOT the leafs which falls away!


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
Jim Hall
Ranch Hand

Joined: Nov 29, 2001
Posts: 162
The join() method is an instance method of the Thread class. So when a running thread (A) calls the join method on another thread (B).It (A) waits until that thread (B) dies before it proceeds.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
In practical terms:- say you need to do two time-consuming, I/O bound jobs A and B. Say they are implemented in two Runnable classes A and B. You need both to be finished in order to carry on.
Because they are I/O bound, it makes a lot of sense to run A and B in parallel using threads:The b.join() statement ensures that the doWork method will only return once both job A and job B have been finished.
- Peter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: join()
 
Similar Threads
Scope International Java development
77% - satisfied. more exam tips
threads.....
what is the output
SCJWSD online Group study