C# 继承的对象实例 的有关问题

it2022-05-05  105

class Parent     {         public void Print()         {             Console.WriteLine(this.GetType());         }     }     class Child : Parent     {     }       class Program     {         static void Main(string[] args)         {             Child c = new Child();             c.Print();         }     }

 

输入结果:

 

 

转载于:https://www.cnblogs.com/jiehu/p/3560451.html


最新回复(0)