• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Design Patterns by
Q:
What is observer design pattern in Java?

1 Answer

0 votes
by
Observer design pattern is one of the behavioral design patterns which defines one-to-many dependencies between objects & is useful when we are interested in a state of an object and we want to get notified when there is any change in state of Object. In Observer design pattern, when one object changes its state, all its dependent objects are automatically notified, the object is called Subject and dependants are called Observers. Java provides libraries to implement Observer design pattern using java.util.Observable class & java.util.Observer interface.

Related questions

0 votes
asked Oct 17, 2019 in Design Patterns by Robin
0 votes
asked Oct 17, 2019 in Design Patterns by Robin
...