Practice pieces


Exceptions

Ok, so here's the simplest way of doing this:

GIS.java
Point.java
OutOfRangeException.java


 

Can you finish this off by:

1) Giving OutOfRangeException a constructor that allows you to set up the print method such that it reports whether it is the x or y variable that is out of range, and what its value is.

2) Get the print method to also print out the exception's stack trace (Hint: check the methods inherited from Exception).