forked from ramram43210/Java_Spring_2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutput.txt
23 lines (23 loc) · 766 Bytes
/
Output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2 observers are listening
price changed to new price = 9000
Before Notify call hasChanged method
Price value changed
JohnObserver is notified, Price changed to 9000
PeterObserver is notified, Price changed to 9000
After Notify call hasChanged method
Price value not changed
------------------------------------------
1 observer is listening
price changed to new price = 20000
Before Notify call hasChanged method
Price value changed
JohnObserver is notified, Price changed to 20000
After Notify call hasChanged method
Price value not changed
------------------------------------------
0 observers are listening
price changed to new price = 30000
Before Notify call hasChanged method
Price value changed
After Notify call hasChanged method
Price value not changed