I\'m trying to understand the Observer and the Observable.
Here\'s an example that I\'m trying to figure out:
public class IntegerDataBag extends Obs
addObserver is a method in the Observable abstract class. See Observable in the Java documentation.Observable. notifyObservers will do nothing until setChanged is set.Observer is a common design pattern. The usual example is when you have a Model and multiple Views. Each View is an Observer on the Model; if the Model changes, the Views get updated.