Skip to content

Instantly share code, notes, and snippets.

@yusufcakal
Created October 12, 2017 08:38
Show Gist options
  • Save yusufcakal/a8e993a580371d43d8514380a0332f7a to your computer and use it in GitHub Desktop.
Save yusufcakal/a8e993a580371d43d8514380a0332f7a to your computer and use it in GitHub Desktop.
Medium Post
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