posted 18 years ago
When you call wait() the running thread releases all locks and waits to be notified by another thread that a condition just happened. In this case, the running thread will block until the condition happens, and then running thread will temporarily abandon the running state.
In the second case, join() will assure that the currently running thread will block until the thread whose join method is called has finished its execution, in other words, when the run() method of the joined thread completes (whether normally o becauase of an exception).
In this case, the running thread will temporarily abandon the running state until the joined thread finishes.