用C#程序实现多态,通过多态的思想,在控制台里输出不同的结果 (下面是java实现的多态,要求用C#实现,输出相同的结果) public class Test { public static void main(String[] args) { Animal[] an = new Animal[3]; an[0] = new Dog(); an[1] = new Cat(); an[2] = new Pig(); for (int i = 0; i < an.length; i++) { an[i].eat(); } } } class Animal{ public void eat(){ System.out.println("animal eat"); } } class Dog extends Animal{ public void eat(){ System.out.println("dog eat"); } } class Cat extends Animal{ public void eat(){ System.out.println("cat eat"); } } class Pig extends Animal{ public void eat(){ System.out.println("pig eat"); } }