public class BadTimeException extends Exception { public BadTimeException() { super("invalid time of day"); } public BadTimeException(String msg) { super(msg); } public static String goodTimes() { return "valid minutes are 0 to 59, valid hours are 1 to 12" + " or 0 to 23"; } /* THIS PART IS NOT EXPECTED public static Time recover(int hours, int minutes) { if (hours < 0) { hours *= -1; } if (minutes < 0) { minutes *= -1; } if (minutes >= 60) { hours += minutes / 60; minutes = minutes % 60; } if (hours >= 24) { hours = hours % 24; } Time temp = new Time(); try { temp = new Time(hours, minutes); } catch (BadTimeException bt) { System.err.println("can't recover from bad time, using defaults"); } return temp; } */ }