1 class FClass{ 2 public string field1 = "输出基类字段"; 3 public void Print1(){ 4 Console.WriteLine("输出基类方法"); 5 } 6 } 7 class CClass : FClass{ 8 new public string field1 = "屏蔽基类字段"; 9 new public void Print1(){ 10 Console.WriteLine("屏蔽基类方法"); 11 } 12 }
原文:https://www.cnblogs.com/My-Sun-Shine/p/13513839.html