// COBOL Programmers Swing With Java - copyright 2005 Doke, Hardgrave, & Johnson // Chapter 5 - Computation // Program to demonstrate ArithmeticException // ArithmeticExceptionDemo.java 1 JAN 05 public class ArithmeticExceptionDemo { public static void main(String args[]) { int a = 5; int b = 0; int c = 0; try { c = a / b; System.out.println ("Successful divide by zero"); } // end try catch (ArithmeticException anException) { System.out.println ("Caught ArithmeticException " + anException); } // enc catch } // end main } // end ArithmeticExceptionDemo.java