The join() method waits for a thread to die. In other words, it causes the currently running threads to stop executing until the thread it joins with completes its task. Join method is overloaded in Thread class in the following ways.
- public void join()throws InterruptedException
- public void join(long milliseconds)throws InterruptedException