title: Catching exceptions in Java
body: <p>There are certain predefined exceptions in Java, which, if thrown, report that something serious has happened and you'd better improve your code, than catching them in a catch block (if I have understood it correctly). But still I find many programs in which I have the following:</p>
  
  <pre><code>} catch (IOException e) {
       ...
  } catch (FileNotFoundException e) {
       ....
  }
  </code></pre>
  
  <p>and I thought that IOException and FileNotFoundException are exactly such kind of exceptions, which we shouldn't catch in a catch block. Why people do this? Is it better to catch them like this? Java compiler warns anyway about any problem of that kind.</p>
  
  <p>Thank you.</p>