Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Main {
- public static void main(String[] args) {
- try {
- // code that generates exception
- int divideByZero = 5 / 0;
- }
- catch (ArithmeticException e) {
- System.out.println("ArithmeticException => " + e.getMessage());
- }
- finally {
- System.out.println("This is the finally block");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment