T
Timo Nentwig
Hi!
Can somebody explain, why update() is not called on notifyObservers()?
public class Observe extends Observable
{
protected class IndexObserver implements Observer
{
public void update(Observable o, Object arg)
{
System.out.println("update()");
}
}
private IndexObserver indexObserver;
public Observe()
{
addObserver(indexObserver = new IndexObserver());
}
public void go()
{
notifyObservers();
}
public static void main(String[] args)
{
(new Observe()).go();
}
}
Can somebody explain, why update() is not called on notifyObservers()?
public class Observe extends Observable
{
protected class IndexObserver implements Observer
{
public void update(Observable o, Object arg)
{
System.out.println("update()");
}
}
private IndexObserver indexObserver;
public Observe()
{
addObserver(indexObserver = new IndexObserver());
}
public void go()
{
notifyObservers();
}
public static void main(String[] args)
{
(new Observe()).go();
}
}