Design Patterns, Behavioural Design, Java, Software Development.
private PaymentStrategy paymentStrategy; public void setPaymentStrategy(PaymentStrategy paymentStrategy) { this.paymentStrategy = paymentStrategy; } public void checkout(double amount) { paymentStrategy.pay(amount); } } // Client code public class StrategyPatternDemo { public static void