Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestExceptions {
- public static void main(String args[]) {
- int d, a;
- try {
- d = 0;
- a = 42 / d;
- System.out.println("This will not be printed.");
- } catch (ArithmeticException e) {
- System.out.println("Division by zero.");
- } finally {
- System. out. println( "Finally") ;
- }
- System.out.println("Out of try/catch/finally - statement");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement