Java Suppressed Exceptions


Notice: A non well formed numeric value encountered in /home/yeezil/javver.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/yeezil/javver.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /home/yeezil/javver.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/yeezil/javver.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Today I learned something new about Java exceptions. The always surprising try-catch statement has a concept called suppressed exceptions. The main idea is that a the whole try structure can throw an exception from more than one place:

  • The catch block
  • The finally block
  • The try-with-resources implicit close

Continue reading