title: Difference between wait(long timeout) and join(long millis)?
body: <p>Both of wait() and join() methods when called by thread-1 on thread-2 makes thread-1 wait for the thread-2, either for sometime or till thread-2 completes.</p>
  
  <p>If we are using the overloaded versions of these methods i.e. wait(long timeout) and join(long millis), then </p>
  
  <ol>
  <li><p>In case of wait(long timeout), thread-1 will become runnable either by notify (or notifyall) or even timeout occurs (whichever is first).</p></li>
  <li><p>In case of join(long millis), thread-2 will become runnable either when thread-2 completes or timeout occurs (whichever is first).</p></li>
  </ol>
  
  <p>So then what is the difference between these two implementations?</p>
  
  <p>Some that I thought are these :-</p>
  
  <ol>
  <li>For wait(), we need to have the lock on the object we are waiting on. For join() these are not necessary.</li>
  <li>After executing wait(), the thread removes lock it obtained and re-gains the lock once it becomes running again. But what about join? Does a thread removes a lock after executing join if this was executed from a synchronized block (or method)?</li>
  </ol>