Multiple choice technology programming languages

Invoking wait(), notify and notifyAll() methods without acquiring lock over an object will lead to:

  1. IllegalMonitorStateException

  2. IllegalThreadStateException

  3. IllegalLockStateException

  4. InvalidLockException

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The wait(), notify(), and notifyAll() methods must be called from within a synchronized context (i.e., while holding the object's lock). Invoking these methods without acquiring the lock results in IllegalMonitorStateException at runtime.