Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ClockDisplay
- {
- private NumberDisplay hour;
- private NumberDisplay minute;
- public ClockDisplay()
- {
- hour = new NumberDisplay(23,23);
- minute = new NumberDisplay(59,56);
- }
- public void printTime()
- {
- System.out.println(hour.getValue() + ":" + minute.getValue());
- }
- public void nextMinute()
- {
- if(minute.getValue() == minute.getMax())
- {
- if(hour.getValue() == hour.getValue())
- {
- minute.forward();
- hour.forward();
- }
- else
- {
- minute.forward();
- }
- }
- else
- {
- minute.forward();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement