自己動手實現設計模式——抽象工廠



package dp.abstractFactory;

public class MainApp {
    // / <summary>
    // / Entry point into console application.
    // / </summary>
    public static void main(String[] args) {
	// Create and run the African animal world
	ContinentFactory africa = new AfricaFactory();
	AnimalWorld world = new AnimalWorld(africa);
	world.RunFoodChain();

	// Create and run the American animal world
	ContinentFactory america = new AmericaFactory();
	world = new AnimalWorld(america);
	world.RunFoodChain();

	// Wait for user input
	// Console.ReadKey();
    }
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章