public class Point { private double x = 0; private double y = 0; public void setX(double xIn) throws OutOfRangeException { if (xIn > 100) { throw new OutOfRangeException(); } x = xIn; System.out.println("X set"); } public void setY(double yIn) throws OutOfRangeException { if (yIn > 100) { throw new OutOfRangeException(); } y = yIn; System.out.println("Y set"); } }