Skip to content

Instantly share code, notes, and snippets.

@PhiHuyHoang
Created October 2, 2018 21:37
Show Gist options
  • Save PhiHuyHoang/944b1acb86e0f8a7b6e25ba8144d077f to your computer and use it in GitHub Desktop.
Save PhiHuyHoang/944b1acb86e0f8a7b6e25ba8144d077f to your computer and use it in GitHub Desktop.
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