/* The error message is Exception in thread "main" java.lang.ArithmeticException: / by zero at Throw1.main(Throw1.java:23) Exit status is 1. Also try the following pairs: double dividend = 1.0; //no exception, prints Infinity double divisor = 0.0; double dividend = Double.MAX_VALUE; //no exception, prints Infinity double divisor = 0.5; double dividend = Double.MIN_VALUE; //no exception, prints 0.0 double divisor = 2.0; and also try int i = Math.addExact(Int.MAX_VALUE, 1); */ public class Throw1 { public static void main(String[] args) { int dividend = 1; int divisor = 0; System.out.println(dividend/divisor); System.exit(0); } }