Just as a note; much of the time the
//class definition here
can be empty; when you're distinguishing between different types of exception (in your catch statement, typically), it's enough to look at - well, the type (i.e., class) of exception. Assuming you make different classes for different types of exception.