Java, Design Patterns, Structural Design Pattern, Software Engineering.
public class MilkDecorator extends CoffeeDecorator { public MilkDecorator(Coffee decoratedCoffee) { super(decoratedCoffee); } public String getDescription() { return super.getDescription() + ", with Milk"; } public double cost() { return super.cost() + 0.50; } } Client Code Usage Now, let’s see how