Let me explain the role of these classes: MySubject class is our main object, Observer1 and Observer2 are objects that depend on MySubject, and Observer1 and Observer2 must change when MySubject changes. The AbstractSubject class defines a list of objects to be monitored, which can be modified: add or delete monitored objects, and when MySubject changes, it is responsible for notifying the objects that exist in the list. Let's look at the implementation code:
< p > This is a paragraph.