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 is the difference between static class and singleton class? can we create static class?

2 Answers   L&T, Octazen, Vamsi Labs,


What is callablestatement? How you can call stored procedure to pass in parameter?

0 Answers  


Every class extends object but why it is not possible for every object to invoke clone() method. ideally protected methods should be accessible from sub classes. isn't it?

2 Answers  


What is Session reduplication and how its done?

0 Answers  


Can we write multiple catch blocks under single try block?

0 Answers  






When should the method invokelater() be used?

0 Answers  


What is user defined exception in Java?

0 Answers   TCS,


What are the Main functions of Java?

0 Answers   Akamai Technologies,


can any body body expalin best definitions & best real time exaples for opps concepts.

0 Answers   Accel,


How to call a Stored Procedure from JDBC?

4 Answers   Satyam,


what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0

4 Answers   Accenture,


What is final class?

0 Answers  


Categories