Home » Interview » Technology

void waitForSignal() { Object obj = new Object(); synchronized (Thread.currentThread()) { obj.wait(); obj.notify(); } } Which statement is true?

Correct Answer: This code can throw an IllegalMonitorStateException.

Explanation:

It will throw  IllegalMonitorStateException.


← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion