What happens if a thread calls `wait()` without holding a lock?
If a thread calls `wait()` without holding a lock, the thread simply doesnâ€™t wait and continues executing.
Thatâ€™s incorrect. A thread must hold the lock before calling `wait()`, otherwise it will throw an exception.
Can you explain why `IllegalMonitorStateException` is thrown when `wait()` is called without holding the lock?