Fixed Can I catch multiple Java exceptions in the same catch clause? #dev #it #asnwer
Fixed Can I catch multiple Java exceptions in the same catch clause? #dev #it #asnwer
Can I catch multiple Java exceptions in the same catch clause?
In Java, I want to do something like this:
try { ... } catch (IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException e) { someCode(); }
try { ... } catch (IllegalArgumentException e) { someCode(); } catch (SecurityException e) { someCode(); } catch (IllegalAccessException e) {…