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 garbage collection? What is the process that is responsible for doing that in java?

640


What are the different data types in java?

520


What is sortedmap in java?

539


What is an immutable object?

569


What is stringbuffer in java?

530






What is visibility mode?

518


Write a program in java to create a doubly linked list containing n nodes.

545


Why can't we override private static methods?

505


How does hashset work in java?

554


What is the access scope of protected access specifier?

527


What is the final keyword denotes?

663


Can we override static methods in java?

570


Can we pass a primitive type by reference in java? How

518


What happens when heap memory is full?

513


What is a constructor, constructor overloading in java?

516