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 derived datatype?

865


How to declare objects of a class ?

802


What does void * mean?

703


What is anagram of a string?

689


What are voids?

720


What happens when I use / and % with a negative numerator?

753


What is serialversionuid?

768


What is annotation in java?

767


why would you use a synchronized block vs. Synchronized method? : Java thread

733


If we don’t want some of the fields not to serialize how to do that?

772


Can two objects have same hashcode?

735


What is the use of parseint in java?

749


what is session in java?

971


Write a program to search a number in the given list of numbers.

819


What are the advantages of user defined functions?

738