package org.example.decorator;
public class ConcreteDecorator extends Decorator {
protected ConcreteDecorator(Component component) {
super(component);
}
@Override
public void method1() {
}
@Override
public void method2() {
}
}
package org.example.decorator;
public class Main {
public static void main(String[] args)
{
Component component = new ConcreteComponent();
Component instance = new ConcreteDecorator(component);
instance.method1();
instance.method2();
Component component1 = new ConcreteDecorator(new ConcreteDecorator(component));
component1.method1();
component1.method2();
}
}