Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What are Observer and Observable? How it is usfull?

 
Anjali K Roy
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What are Observer and Observable? How it is usfull in Real time pls explain.
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
according to the javadoc,
A class can implement the Observer interface when it wants to be informed of changes in observable objects.

The javadoc for the Observable class tells a little bit more about it:
sun's javadoc for java.util.Observable
These are used to allow a class (the Observable) let everyone who is interested (the Observer(s)) know about a change in its status.
 
Tim Troy
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is some more to read.
Java World How-To
Java World Tip
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic