public class Add { private int z; public Add (int x, int y) throws IntegerOverflowException { IntegerOverflowException ex = new IntegerOverflowException ("Integer overflow"); z = x + y; if (x>0 && y>0 && z<0) throw ex; } public double getValue () { return z; } }