title: Why use IOexception instead of Exception when catching?
body: <p>I can't seem to phrase this correctly for the search engine to pick up any meaningful results.</p>
  
  <pre><code>try{
      BufferedReader reader = new BufferedReader( new FileReader("foo.bar") );
  }
  catch(Exception e){
      println( e.getMessage() );
  }
  </code></pre>
  
  <p>So <code>FileReader</code> only throws the <code>FileNotFoundException</code>, which as I understand it is an <code>IOException</code>, which is an Exception.  Can someone explain why I would catch <code>FileNotFoundException</code> or <code>IOException</code> instead of just specifying the generic "Exception" and not having to import an exception (i.e. import <code>java.io.FileNotFoundException;)</code>?  Is it strictly for readability?</p>
  
  <p>I've caught the exception using all three names and I can't find a difference.</p>
  
  <p>EDIT:--------------------</p>
  
  <pre><code>private BufferedReader askUserForFile(String prompt){
          BufferedReader rd = null;
          while(rd == null){
              try{
                  String filename = readLine(prompt);
                  rd = new BufferedReader( new FileReader(filename) );
              }
              catch(Exception e){
                  println(e.getMessage());
              }
          }
          return rd;
      }
  </code></pre>