title: Is it okay to use try catch inside finally?
body: <p>I am using a buffered writer and my code, closes the writer in the finally block. My code is like this.</p>
  
  <pre><code> ...........
      BufferedWriter theBufferedWriter = null;
      try{
      theBufferedWriter =.....
      ....
      ......
      .....
      } catch (IOException anException) {
      ....
      } finally {
          try {
              theBufferedWriter.close();              
          } catch (IOException anException) {
              anException.printStackTrace();
              }
      }
  </code></pre>
  
  <p>I have to use the try catch inside the clean up code in finally as theBufferedWriter might also throw an IOException. I do not want to throw this exception to the calling methos. Is it a good practice to use a try catch in finally? If not what is the alternative? Please suggest. </p>
  
  <p>Regards,
  Hiral</p>