Programming a simple clock
Why do you check the time with (hours - 12 &lt; 0). This involves two operations, one subtraction and one compare. You could simply use (hours &lt; 12).

Also you rely that in the method set24hrTime(int newTime) the time is never > 23 for your code to work. Why don't you check this?

Also what about the value 0 for your hours? This must be displayed as 12 AM. At the moment you return 0 in this case where it must be 12.

Also for the value 12 of the hours you return 0 as value for the 12hrTime which is wrong.

To sum up I would suggest the following code:

public Clock {
    private int time = 0;
    public int get24hrTime() {
        return time;
    }
    public int set24hrTime(int newTime) {
        if (newTime &gt; 23 || newTime &lt; 0) {
            throw new IllegalArgumentException();
        }
        this.time = newTime;
    }
    public int get12hrTime(){
        if (time == 0) {
            return 12; // Special case 0
        } else if (time &lt;= 12) {
            return time;
        } else {
            return time - 12;
        }
    }
    public String get12hrPostfix() {
        if (time &lt; 12) {
            return "AM";
        } else {
            return "PM";
        }
    }
}