Type a multi-catch block for IOException and SQLException
Type a multi-catch block for IOException and SQLException
Answer
try { run(); } catch (IOException | SQLException e) { logger.error(e.getMessage(), e); }
Multi-catch is sugar for two catch blocks with identical bodies. The alternatives must not be subclass-related. e is effectively final.