Counter Class
public Counter(int max) {
observers = new Vector();
public void reset() { /*Same as before*/ }
public int getVal() { /*Same as before*/ }
public void setVal(int val) { /*Same as before*/ }
public void inc() { /*Same as before*/ }
public void dec() { /*Same as before*/ }
public void registerAsObserver(CounterObserver observer){…}
private void notifyObservers() {…}
Vector observers; // Allows multiple observers