java设计模式|装饰模式
package decotator;
public class DecoratorTest {
public static void main(String[] args) {
// Component component = new ConcreteComponent();
// component.operation();
Component component = new ConreteDecotator2(new ConreteDecotator1(new ConcreteComponent())) ;
component.operation();
}
}
interface Component{
void operation();
}
class ConcreteComponent implements Com
java设计模式|装饰模式最先出现在Python成神之路。
共有 0 条评论