Last active
October 22, 2019 00:36
-
-
Save secondspass/05b218825fe55a712b50a8c50fa01fd7 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
import java.util.*; | |
class FoodFactory extends Solution { | |
} | |
class Food extends Solution { | |
} | |
class Solution { | |
FoodFactory ff = new FoodFactory(); | |
Food fastfood = FoodFactory.getFood("Fast Food"); | |
Food orange = FoodFactory.getFood("Orange"); | |
System.out.println("the food is "+fastfood.getClass().getName()); | |
System.out.println("the food is "+orange.getClass().getName()); | |
// The output should be: | |
// the food is Fast Food | |
// the food is Orange | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment