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

What is the difference between C++ and Java and your preferences?

618


What is java life cycle?

541


Can we have more than one package statement in source file ?

592


What is a list in java?

512


Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1440






Explain what access modifiers can be used for methods?

572


What is factor r?

529


why java uses class level type casting ?

2257


Is arraylist zero based?

559


Can we define constructor in inner class?

545


How to do a true java ping from windows?

620


What is the meaning of 3 dots in java?

685


What is assembly used for?

508


Is string pool garbage collected?

555


How static variable work in java?

602