title: does instanceof work for subclassed exceptions?
body: <p><code>java.net.ConnectException</code> extends <code>java.net.SocketException</code></p>
  
  <p>If I do the following, will it cater for both exceptions? ie if I catch a "parent" exception using <code>instanceof</code>, does that include any subclassed exceptions?</p>
  
  <pre><code>catch (Exception e)
  {
     if (e instanceof java.net.SocketException)
     {
        System.out.println("You've caught a SocketException, OR a ConnectException");
     }
  }
  </code></pre>
  
  <p>(and for the record, yes I know catching plain Exceptions is bad, just using it for this example ;) )</p>