title: IllegalMonitorStateException on wait() call
body: <p>I am using multi-threading in java for my program.
  I have run thread successfully but when I am using <code>Thread.wait()</code>, it is throwing <code>java.lang.IllegalMonitorStateException</code>.
  How can I make a thread wait until it will be notified?</p>