Difference between wait() and notify() in Java
Feature wait() notify()
Purpose Causes current thread to wait. Wakes up a single waiting thread.
Defined In Object class Object class
Lock Handling Releases the object's lock. Does not release lock immediately.
Synchronization Must be called inside a synchronized block/method.
Same.
Usage Used to pause thread until a condition isUsed
met. to signal that the condition has changed