Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public class NumberDisplay
  2. {
  3.     private int max;
  4.     private int value;
  5.  
  6.     public NumberDisplay(int clockMax, int clockValue)
  7.     {
  8.         max = clockMax;
  9.         value = clockValue;
  10.     }
  11.  
  12.     public int getValue()
  13.     {
  14.         return value;
  15.     }
  16.    
  17.     public int getMax()
  18.     {
  19.         return max;
  20.     }
  21.    
  22.     public void forward()
  23.     {
  24.         if(value == max)
  25.         {
  26.             value = 0;
  27.         }
  28.         else
  29.         {
  30.             value++;
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement