Created
October 2, 2018 21:37
-
-
Save PhiHuyHoang/944b1acb86e0f8a7b6e25ba8144d077f to your computer and use it in GitHub Desktop.
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
class GirlFactory | |
{ | |
public void checkGirl(String national) | |
{ | |
Girl girl; | |
if(national.Equals("Vietnam")) | |
{ | |
girl = new Vietnamese(); | |
girl.check(); | |
} | |
else if (national.Equals("China")) | |
{ | |
girl = new Chinese(); | |
girl.check(); | |
} | |
else if (national.Equals("Japan")) | |
{ | |
girl = new Japanese(); | |
girl.check(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment