wiley_pastebin

lesson 2 clockdisplay 3

Mar 15th, 2019
3,373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.23 KB | None | 0 0
  1. public class NumberDisplay {
  2.  //...
  3.  
  4.  public void tick() {
  5.   value = (value + 1) % limit;
  6.  }  
  7.  
  8.  public String getDisplayValue(){
  9.   if(value < 10){
  10.    return "0" + value;
  11.   }
  12.   else {
  13.    return "" + value;
  14.   }
  15.  }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment