title: Beginner here, programming a simple counter to have a limit?
body: <p>Here is my counter class.</p>
  
  <pre><code>public class Counter {
  
      private int value;
  
      public int getValue() {
          return value;
      }
  
      public void click() {
          value = value + 1;
      }
  
      public void unclick() {
          value = value - 1;
      }
  
      public void reset() {
          value = 0;
      }
  
      public void setLimit(int maximun) {
          maximun = 10;
      }
  }
  </code></pre>
  
  <p>and here is my tester</p>
  
  <pre><code>public class counterDemo {
  
      public static void main(String[] args) {
          Counter tally = new Counter();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          tally.click();
          int result = tally.getValue();
          System.out.println("results: " + result);
      }
  
  }
  </code></pre>
  
  <p>I'm asked to use math.min(n, limit) to make it so if the click is used more often than limit, it has no effect. Could anyone help me? This seems really simple but I haven't seen something like this used and cant figure it out. Thanks</p>