CHAPTER 21: The Package java.util Previous
Previous
Java Language
Java Language
Index
Index
Next
Next

21.8 The Interface java.util.Observer

21.8.1 update

A class should implement the Observer interface if it is to be notified whenever an Observable object has been changed. See the Observable class (S21.7) for a discussion of how Observer objects are notified.

public interface Observer {
	public void update(Observable o, Object arg);
}


21.8.1 update

public void update(Observable o, Object arg)

When an Observable object has been changed and its notifyObservers method (S21.7.6) is called, every Observer object in its set of observers is notified by invoking its update method, passing it two arguments: the Observable object and another argument specified by the call to the notifyObservers method.

© 1996 Sun Microsystems, Inc. All rights reserved.