title: Question about multiple 'catch'
body: <p>Can anyone tell me why the output of this class is  'xa'?</p>
  
  <p>why the other exception(RuntimeException and Exception ) won't be caught?</p>
  
  <pre><code>public class Tree {
      public static void main(String... args) {
          try
          {
              throw new NullPointerException(new Exception().toString());
          }
          catch (NullPointerException e)
          {
              System.out.print("x");
          }
          catch (RuntimeException e)
          {
              System.out.print("y");
          }
          catch (Exception e)
          {
              System.out.print("z");   
          }        
          finally{System.out.println("a");}
      }
  }
  </code></pre>