class Except { public static void main(String args[]) { for (int i = 6; i > -3; i--) { try {System.out.println(i+" "+sq(i));} catch(ArithmeticException e){System.out.println(i+" "+ e);} finally {System.out.println("Es ist geschafft");} } } static double sq(int i) { if (i < 0) throw new ArithmeticException(); return Math.sqrt((double) i); } static double sqx(int i) { double er = (double) i; return Math.sqrt(er); } }