1
18
19
20
21
22
23
24
25
26
27
28
29
// {...}
public class Main {
public static void main(String[] args) {
double price = 100;
PaymentStrategy paymentStratgy = PaymentStrategy.cashPayment();
System.out.println("Cash Price: -" + paymentStratgy.pay(price));
paymentStratgy = PaymentStrategy.creditCardPayment();
System.out.println("Credit Card Price: -" + paymentStratgy.pay(price));
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX