public final void wait() throws java.lang.InterruptedException {
  wait(0);
}

public final void wait ( ) throws java . lang . InterruptedException { wait ( 0 ) ; }
causes current thread to wait until another thread invokes the method or the method for this object . in other word ' s this method behaves exactly as if it simply performs the call wait ( 0 ) . the current thread must own this object ' s monitor . the thread releases ownership of this monitor and waits until another thread notifies threads waiting on this object ' s monitor to wake up either through a call to the notify method or the notifyall method . the thread then waits until it can re - obtain ownership of the monitor and resumes execution . this method should only be called by a thread that is the owner of this object ' s monitor . see the notify method for a description of the ways in which a thread can become the owner of a monitor .
