答案为什么是B?
void waitForSignal(){
Object obj=new Object();
synchronized(Thread.currentThread()){
obj.wait();
obj.notify();
}
}
what statement is ture?
A.this code may throw an InterruptedException.
B.this code may throw an IllegalStateException.
C.this code may throw a TimeoutException after ten minutes.
D.this code will not compile unless "obj.wait()" is replace with "((Thread)obj).wati()".
E.a call to notify() or notifyAll() from another thread may cause this method to complete normally.