Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleFørste versjon av Counter-klassen
linenumberstrue
public class Counter {
   private int start, end, pos;
   public Counter(int start, int end) {
      this.start = start;
      this.end = end;
   }
   public int getCounter() {
      return this.pos;
   }
   public boolean count() {
      if (pos >= end) {
         return false;
      }
      this.pos = this.pos + 1;
      return true;
   }
}

...