示例#1
0
        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();
        }
示例#2
0
 public static void Show(IDengJi dj)
 {
     dj.DengJi();
 }
示例#3
0
 static void DengJi(IDengJi dj)
 {
     dj.DengJi();
 }
示例#4
0
 public static void GetDengji(IDengJi dj)
 {
     dj.DengJi();
 }