You are viewing a single comment's thread. Return to all comments →
Another way without any concern of the exception class:
catch(Exception e){ System.out.println(e.getClass().getName() + (e.getMessage() != null && e instanceof ArithmeticException ? (": " + e.getMessage()) : "")); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Exception Handling (Try-catch)
You are viewing a single comment's thread. Return to all comments →
Another way without any concern of the exception class: