Both NetBeans and IntelliJ (and probably Eclipse, too) would warn that the exception has already been handled. They just warn you about it in slightly different ways.

The zoo exceptions are certainly colorful, but standard JDK exceptions are easier examples, in my opinion.

        try {
// Something that causes IllegalArgumentException
} catch (Exception e) {
// Handle it somehow
} catch (RuntimeException re) {
// Already caught and handled
} catch (IllegalArgumentException iae) {
// Also already caught and handled

is a composer and photographer from Detroit, Michigan. He has been working on a Java program to display certain mathematical diagrams.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store