抽象工厂模式(Abstract Factory)[4]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

                        return new Wildebeest();

            }

            public Carnivore CreateCarnivore(){

                        return new Lion();

            }

}

 

public class AmericaFactory implements ContinentFactory{

            public Herbivore CreateHerbivore(){

                        return new Bison();

            }

            public Carnivore CreateCarnivore(){

                        return new Wolf();

            }

}

 

//AbstractProduct

 

public interface Herbivore{

}

 

 

本文关键:抽象工厂模式(Abstract Factory)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top