Start here. This is the direct spoken answer to practice first.
Overview
wait and notify are low-level monitor primitives; most application coordination has a clearer library abstraction.
wait releases the monitor and suspends the thread until notification, interruption, or a spurious wakeup; the caller must own that monitor. The condition must be checked in a loop because waking does not prove it is now true. notify wakes one waiter, while notifyAll wakes all waiters to compete for the monitor. These primitives are correct only as part of a carefully defined guarded-state protocol.