JAVA IO流与装饰者模式

装饰者模式(decorator)介绍 定义: 动态地将责任附加到对象上。若要扩展功能,装饰者提供了比继承更有弹性的替代方案。java 例子: package wfb.test; public class decorator { public static void main(String[] args) { String name = "bin"; A a = new A(name); B b =
相关文章
相关标签/搜索