自己动手实现设计模式——抽象工厂

来源:互联网 发布:js 地球3d旋转动画 编辑:程序博客网 时间:2024/05/01 13:04



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 worldContinentFactory africa = new AfricaFactory();AnimalWorld world = new AnimalWorld(africa);world.RunFoodChain();// Create and run the American animal worldContinentFactory america = new AmericaFactory();world = new AnimalWorld(america);world.RunFoodChain();// Wait for user input// Console.ReadKey();    }}


原创粉丝点击