錯誤:Exception in thread 「A」 java.lang.IllegalMonitorStateException 如圖: 錯誤原因:使用wait(),notifyAll(),方法沒有加鎖. 解決:加上synchronized 鎖