实现AbstractProduct接口
Client(AnimalWorld)
使用AbstractFactory和AbstractProduct类
代码:
//AbstractFactory
public interface ContinentFactory{
public Herbivore CreateHerbivore();
public Carnivore CreateCarnivore();
}
//ConcreteFactory
public class AfricaFactory implements ContinentFactory{
public Herbivore CreateHerbivore(){