title: wait method wakes up without calling notify(NOT SPURIOUS WAKEUP)
body: <p>In the statement below, the <code>wait()</code> method is executed even though no notify is called but the statement <code>below wait()</code> are executing only after <code>laurel</code> thread completes its execution.</p>
  
  <p>I tried using other objects for locking in synchronization of hardy block this time wait method is still waiting forever, can someone explain me why statement after <code>wait()</code> was executed?</p>
  
  <pre><code>package delagation;
  
  public class Solution extends Thread {
  
      static Thread laurel, hardy;
  
      public static void main(String[] args) throws InterruptedException {
          laurel = new Thread() {
              public void run() {
                  System.out.println("A");
                  try {
                      hardy.sleep(1000);
                  } catch (Exception e) {
                      System.out.println("B");
                  }
                  System.out.println("C");
              }
          };
          hardy = new Thread() {
              public void run() {
                  System.out.println("D");
                  try {
                      synchronized(laurel) {
                          laurel.wait();
                          //wait method is called here, 
                          //There is not notify in this class, 
                          //but the statement below are executing
                          System.out.println(Thread.currentThread().getName());
                      }
                  } catch (Exception e) {
                      System.out.println("E");
                  }
                  System.out.println("F");
              }
          };
          laurel.setName("laurel");
          hardy.setName("hardy");
          laurel.start();
          hardy.start();
      }
  }
  </code></pre>