Back To Java Exceptions Index
//program to demonstrate exception arithmetic exception public class arithmeticexception { 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"); } System.out.println("After catch statement"); } }