How Do You Use Wait And Notify?
How Do You Use Wait And Notify? Simply put, calling wait() forces the current thread to wait until some other thread invokes notify() or notifyAll() on the same object. For this, the current thread must own the object’s monitor. Why do we need the wait () and notify () methods? We wait on an object