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

What do you understand by the bean persistent property?

0 Answers  


What are MalformedURLException and UnknownHost Exceptions and whey they will be thrown?

2 Answers  


What are the differences between unchecked exception, checked exception, and errors?

2 Answers  


What JNDI(Java Naming and Directory Interface) provides?

4 Answers  


What is the diff. b/w Interfaces & Abstract class?

6 Answers   Ericsson,


What is the main advantage of passing argument by reference?

0 Answers  


How to compare strings in java?

0 Answers  


where the static methods will live ,on stack ? can you explain brefly

1 Answers  


What is the epoch date?

0 Answers  


Convert a BST into a DLL and DLL to BST in place.

0 Answers   Amazon,


Can we declare Pointer in Java?

5 Answers  


What is the primary benefit of encapsulation?

0 Answers  


Categories