Last active
July 8, 2018 12:25
-
-
Save hnjaman/3acc7fa337842cc7c73695c0997de865 to your computer and use it in GitHub Desktop.
Factory pattern
This file contains hidden or 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 BeautyParlor extends Service { | |
@Override | |
double getCost() { | |
return 5000; | |
} | |
@Override | |
String serviceStatus() { | |
return "Bride is ready and "+getCost()+" is your bill \n"; | |
} | |
} |
This file contains hidden or 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 Cook extends Service { | |
@Override | |
double getCost() { | |
return 20000; | |
} | |
@Override | |
String serviceStatus() { | |
return "Items are ready and "+getCost()+" is your bill \n"; | |
} | |
} |
This file contains hidden or 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 Decorator extends Service { | |
@Override | |
double getCost() { | |
return 10000; | |
} | |
@Override | |
String serviceStatus() { | |
return "Decoration is ready and "+getCost()+" is your bill \n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment