| Author |
Observing Java Objects
|
bhaswar goswami
Greenhorn
Joined: Jul 04, 2005
Posts: 14
|
|
Hi, When we try to change one Java objects that is being Observed by some other java objcts(Observer ) then the following method is called void update(Observable o, Object arg) - of the Observer objects first agrument is the Observable Object that is changed , but i don't know the purpose of the second argument . I want o know when this second parameter is used and how ?
|
Regards,
Bhaswar Goswami
SCJP 5.0 , SCDJWS
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12929
|
|
|
It's an arbitrary object that you can pass to the observers. You decide yourself what you pass there - it can be any object you like. You can use it to give the observers some more info about what was changed in the observable. Just whatever is useful for what you are using the Observable / Observer class and interface for.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Observing Java Objects
|
|
|