Sunday

Java - Invalid Number Exception

public class JInvalidNumberException extends Exception {
String mistake;

public JInvalidNumberException()
{
super();
mistake = "Unknown error.";
}

public JInvalidNumberException(String reason)
{
super(reason);
mistake = reason;
}
}

Above is customized exception that is created to be thrown when a invalid postal code enter by a user.

No comments:

Post a Comment