How are Observer and Observable used?

Answer Posted / nimisha

Objects that subclass the Observable class maintain a list
of observers. When an Observable object is updated it
invokes the update() method of each of its observers to
notify the observers that it has changed state. The
Observer interface is implemented by objects that observe
Observable objects.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is hashset in java?

532


What are the differences between checked exception and unchecked exception?

527


Why is string class considered immutable?

598


can I implement my own start() method? : Java thread

555


Can you extend main method in java?

624






Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?

611


what is bmg file and how to create that files?what will it contailn?

1892


Explain all java features with real time examples

1211


Is ruby built on java?

535


Which are the two subclasses under exception class?

531


How to add menushortcut to menu item?

566


Is main a function?

516


Is linkedlist thread safe in java?

563


What is numeric function?

542


How can we access some class in another class in java?

555