Java Interview Questions - How are Observer and Observable used?

Answer : Objects that subclass the Observable class maintain a list of observers. When an Observable bject
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.

0 comments:

Post a Comment

 
Copyright © Interview Questions and answers - Blogger Theme by BloggerThemes & freecsstemplates - Sponsored by Internet Entrepreneur