void waitForSignal(){
Object ob =new Object();
synchronized (Thred.currentThread()) {
try {
ob.wait();
ob.notify();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
此方法拋出IllegalMonitorStateException。有人可以解釋爲什麼如此。此代碼可以拋出IllegalMonitorStateException
在此先感謝