Here you can find the source of validateHoursAndMinutes(int hours, int minutes)
Parameter | Description |
---|---|
hours | - 0 to 23 |
minutes | - 0 to 59 |
Parameter | Description |
---|---|
NumberFormatException | if digital time format invalid |
protected static void validateHoursAndMinutes(int hours, int minutes) throws NumberFormatException
//package com.java2s; public class Main { /**//from w w w . j a v a2 s .c o m * Checks that hour and minutes within conventional 24 hour clock bounds. * * @param hours - 0 to 23 * @param minutes - 0 to 59 * @throws NumberFormatException if digital time format invalid * */ protected static void validateHoursAndMinutes(int hours, int minutes) throws NumberFormatException { if ((minutes >= 60 || minutes < 0) || (hours >= 24 || hours < 0)) { throw new NumberFormatException(); } } }