摘要: 测试结果 image.png image.png Color枚举的本质就是一个类,编译器会自动为我们生成Color类,通过反编译得到该类如下: 可以看出每个枚举类型颜色是该Color类的一个实例对象,该构成方式和单例模式有些类似,故可以用只有一个枚举类型的枚举作为单例模式,而且枚举的构造器由编译器管 阅读全文
posted @ 2019-06-12 23:39 爱在惜缘前 阅读(7636) 评论(0) 推荐(1) 编辑
摘要: Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.Chain the receiving objects and p 阅读全文
posted @ 2019-06-12 21:25 爱在惜缘前 阅读(161) 评论(0) 推荐(0) 编辑