title: Exception in java for wait() method
body: <pre><code>public class Bees {
      public static void main(String[] args) {
          try {
              new Bees().go();
          } catch (Exception e) {
              System.out.println("thrown to main" + e);
          }
      }
  
      synchronized void go() throws InterruptedException {
          Thread t1 = new Thread();
          t1.start();
          System.out.print("1 ");
          t1.wait(5000);
          System.out.print("2 ");
      }
  }
  </code></pre>
  
  <p>Output of this Program is : </p>
  
  <pre><code>1 thrown to main
  </code></pre>
  
  <p>I am not getting why this <code>thrown to main</code> came over here.</p>