How are Observer and Observable used?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to perform merge sort in java?

572


Can an interface be final?

537


What is a newline character in java?

550


Can java arraylist hold different types?

484


Can a constructor be made final?

650






How we can declare a static variable?

637


Is java jre still free?

514


What does regex mean?

551


What is java and their uses?

542


What technique can be employed to compare two strings?

561


Is singleton class thread safe?

522


How do I know if java is installed?

504


What is stack explain?

490


What are the two parts of a conditional statement?

500


Can you access non static variable in static context?

545