public static void GetDengJi(IDengJi dj) { //如果每一个子类中的方法都不一样,并且没有重写,才需要判断 //可以省略 //if (dj is Student) //{ // dj = new Student(); //} //else if (dj is Car) //{ // dj = new Car(); //} //else if (dj is House) //{ // dj = new House(); //} dj.DengJi(); }
public static void Show(IDengJi dj) { dj.DengJi(); }
static void DengJi(IDengJi dj) { dj.DengJi(); }
public static void GetDengji(IDengJi dj) { dj.DengJi(); }