title: Why won't main method catch the uncaught exception from catch block
body: <p>I came up with this example while studying mock exams for OCPJP certification,<br>
  (from <a href="http://www.certpal.com" rel="nofollow">http://www.certpal.com</a> version 1.6 exam part 3, Flow Control, Question number 8)</p>
  
  <pre><code>public class Oak 
  {
      public static void main(String args[])  
      {
          try
          {
              Integer i =null;
              i.toString();
          }
          catch (Exception e)
          {
              try
              {
                  System.out.println("One ");
                  Integer i =null;
                  i.toString();                
              }
              catch (Exception x)
              {
                  System.out.println("Two ");
                  Integer i =null;
                  i.toString();                   
              }
              finally
              {
                  System.out.println("Three ");
                  Integer i =null;
                  i.toString();                            
              }
          }
          finally
          {
              System.out.println("Four ");
          }
      }
  }
  </code></pre>
  
  <p>I am fully aware that finally blocks always execute unless there is a System.exit(), so I traced the program and decided that it will have an output like this</p>
  
  <blockquote>
    <p>One Two Exception in thread "main" java.lang.NullPointerException Three Exception in thread "main" java.lang.NullPointerException Four</p>
  </blockquote>
  
  <p>However, it turns out the correct output is (according to the site and Eclipse debugging)</p>
  
  <blockquote>
    <p>One Two Three Four Exception in thread "main" java.lang.NullPointerException</p>
  </blockquote>
  
  <p>What I'm not understanding is, where did the exception which occurs in catch block with "Two" go?</p>
  
  <p>There is no catch block underneath that, shouldn't it be thrown by the main thread too? Because it's not catched?</p>