3 ms·
Weird example with the "Java 8 exception handling": catch (Exception e) { if (e instanceof IOException) { } else if (e instanceof SQLException) {
by mrkeen 2y ago
Weird example with the "Java 8 exception handling":
catch (Exception e) {
if (e instanceof IOException) {
} else if (e instanceof SQLException) {
} else if (e instanceof NumberFormatException) {
} else {
}
}
Older Javas already allowed choosing which Exceptions (and subclasses) to catch directly.