New answers tagged

0

An observable class, which has the add/remove methods: private List<MyObserver> observers; public void addObserver(MyObserver o) { observers.add(o); } public void removeObserver(MyObserver o) { observers.remove(o); } The notify methods, which don't need to be public. They may be called when anything occurs, also in the observable class. ...



Top 50 recent answers are included