> Hi,
>
[quoted text clipped - 11 lines]
> specific exception
> e.g. InvalidUserNameException extends Exception
Your rule "A" should be changed so that the exceptions of interest
extend RuntimeException, or one of its subclasses. NullPointerException is a
subclass of RuntimeException, so the example still works.
Similarly, in "B" you could extend any exception which is not a
RuntimeException (Exception itself is an exception, but not a runtime
exception).
Also, don't be afraid to occasionally throw one of Sun's built-in
exceptions, instead of defining your own.
- Oliver