摘要: public class MyList { Entry head; class Entry { Object data; Entry next; public Entry(Object data) { this.data = data; this.next = null; } public Entr 阅读全文
posted @ 2019-11-12 20:15 Andrew_F 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 被观察者为商品,观察者为具体的业务实现,如发邮件,修改页面价格;当商品价格变化后,通知所有被观察者进行业务更新 package observer; import java.util.HashSet; /** * @description 被观察者 **/ public class Product { 阅读全文
posted @ 2019-11-12 11:21 Andrew_F 阅读(101) 评论(0) 推荐(0) 编辑