Last active
March 18, 2019 05:23
-
-
Save sahoosunilkumar/34524874e3663f213b5ec4de09aa4b89 to your computer and use it in GitHub Desktop.
factory method call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MakePayment { | |
public static void main(String args[]) { | |
IPayment payment = PaymentFactoryMethod.createPayment(PaymentType.PAYTM); | |
payment.pay(); | |
payment = PaymentFactoryMethod.createPayment(PaymentType.GOOGLEPAY); | |
payment.pay(); | |
payment = PaymentFactoryMethod.createPayment(PaymentType.PAYPAL); | |
payment.pay(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment