package eecs1022.midterma; /** * A counter. * * @author Franck van Breugel */ public class Counter { private int value; /** * Initializes the value of this counter to zero. */ public Counter() { this.value = 0; } /** * Increments the value of this counter by 1. */ public void increment() { this.value++; } /** * Tests whether the value of this counter has reached the limit 5. * * @return true id the value of this counter is 5, false otherwise. */ public boolean reachedLimit() { final int LIMIT = 5; return this.value == LIMIT; } }