Java Observer Update function

后端 未结 3 778
陌清茗
陌清茗 2021-01-03 09:16

I have a class that implements observer, and of course it needs to have the update function:

public void update(Observable obs, Object obj);
<
3条回答
  •  长情又很酷
    2021-01-03 09:35

    The observer's update(Observable obs,Object obj) method receives through the notifyObservers the object(second parameter) who has changed(in the Observable).

提交回复
热议问题