Pet[] pets = new Pet[] {new Dog("Jack"),new Cat("Tom")}; 转载于:https://www.cnblogs.com/deepsleepinger/p/9827321.html