title: Catching java exceptions FileNotFound and IOException at the same time
body: <p>Is the FileNotFoundException somehow a "sub-exception" of the IOException?</p>
  
  <p>This is my code opening an input stream to a file at the given path:</p>
  
  <pre><code>   method(){
          FileInputStream fs;
          try {
              fs = new FileInputStream(path);
              //
              fs.close();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>How come I can neglect the FileNotFound and just catch the IOException instead? 
  Is the FNFException a part of the IOException?</p>
  
  <p>Instead of catching the exceptions, what if I throw an IOException in my method? </p>
  
  <pre><code>    method() throws IOException{
  
          FileInputStream fs;
          fs = new FileInputStream(path);
          //
          fs.close();
  
      }
  </code></pre>
  
  <p>Can I proceed to catch a FileNotFoundException at the invoking method like this?</p>
  
  <pre><code>    try {
  
           method();
  
      }catch (FileNotFoundException e1) {}
  </code></pre>
  
  <p>Thanks for any help you might be able to provide!</p>