Q:
void waitForSignal() {
Object obj = new Object();
synchronized (Thread.currentThread()) {
obj.wait();
obj.notify();
}
}
Which statement is true?
Answer & Explanation
Answer: B) This code can throw an IllegalMonitorStateException.
Explanation: It will throw IllegalMonitorStateException.
View Answer
Report Error
Discuss