//Throw and catch an exception. public class Throw2 { public static void main(String[] args) { int dividend = 1; int divisor = 0; try { System.out.println(dividend/divisor); } catch (Exception e) { System.err.println(e); System.err.println(e.toString()); System.err.println(e.getMessage()); System.exit(1); } System.exit(0); } }