I was running the code below and thought of commenting the line calling notify(). So that I may see if I get IIlegalMonitorStateException. But the code ran successfully without throwing error. Please explain me why? Isn't it necessary for the thread to send notify() to the waiting thread? I think main() thread should throw the exception after not receiving notification from ThreadB b? Please correct me ...if my understanding is wrong..?