Created
October 12, 2017 08:38
-
-
Save yusufcakal/a8e993a580371d43d8514380a0332f7a to your computer and use it in GitHub Desktop.
Medium Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
UserMan userMan = new UserMan(); | |
UserWoman userWoman = new UserWoman(); | |
NoticeObservable noticeObservable = new NoticeObservable(); | |
userWoman.setObservable(noticeObservable); | |
noticeObservable.addObserver(userMan); | |
noticeObservable.addObserver(userWoman); | |
noticeObservable.notifyObserver(); | |
userWoman.removeObserver(); | |
noticeObservable.notifyObserver(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment