<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">public class Time {
  private int hr; // hour of day, 0..23
  private int min; // minute of hour, 0..59
  
  /** construct the time h:m.
    * precondition: h in 0..23, m in 0..59 */
  public Time(int h, int m) {
    hr = h;
    min = m;
  }
  
  /** construct m minutes after midnight 
    * pre: m in 0..1439*/ 
  public Time(int m) {
    hr = m / 60;
    min = m % 60;
  }
  
  /** hour of the day */
  public int getHour() {
    return hr;
  }
  
  /** minute of the hour */
  public int getMin() {
    return min;
  }
  
  public String toString() {
    return hr + ":" + (min &lt; 10 ? "0" + min : min);
  }
  
  public static void main(String[] args) {
    Time t = new Time(10,1);
    System.out.println(t);
  }
  
}</pre></body></html>