How are Observer and Observable used?

Answers were Sorted based on User's Feedback



How are Observer and Observable used?..

Answer / 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

How are Observer and Observable used?..

Answer / guest

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

How are Observer and Observable used?..

Answer / supriya

Subclass of Observable class maintain a list of observers.
Whenever an Observable object is updated, it invokes the
update() method of each of its observers to notify the
observers that it has a changed state.
An observer is any object that implements the interface
Observer.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Core Java Interview Questions

Iterator in the HashMap is fail-safe means what?

9 Answers   CTS, IBM, Subex,


Describe what a thread-local variable is in java?

0 Answers  


I have a String s = java; What is the output when I say s.replaceAll('j', 'k'); Also what is the value of s after replacing?

8 Answers   KPIT,


Write a program to print fibonacci series

0 Answers  


List interface?

2 Answers  






what is webservices?

1 Answers   CTS, Ericsson, HCL,


Differentiate between overriding and overloading cases?

0 Answers   Amdocs,


What is java reflection api?

0 Answers  


How do you compare objects in java?

0 Answers  


What do you mean by thread safe?

0 Answers  


What are the two types of java programming?

0 Answers  


Can an abstract class be a final class?

0 Answers  


Categories