previous | start | next

## Defining Exception Classes

- Decide exception should be checked
- Subclass `Exception` or `RuntimeException`
- Provide two constructors

      public class IllegalFormatException extends Exception

      {

         public IllegalFormatException() {}

         public IllegalFormatException(String reason)

         { super(reason); }

      }

- Throw exception when needed:
  `throw new` IllegalFormat `Exception("number expected");`

previous | start | next