我知道从另一个类继承的类可以使用new
关键字隐藏属性。但是这只是隐藏了该属性的特定实现,所以我能够理解它的用途。
在实现其他接口的接口中隐藏成员是否有任何实际意义?例如,请考虑以下示例。IChildInterface
实现了IParentInterface
并隐藏了PropertyA
。
interface IParentInterface
{
string Name { get; set; }
int PropertyA { get; set; }
int PropertyB { get; set; }
}
interface IChildInterface : IParentInterface
{
int PropertyA { get; set; }
int PropertyC { get; set; }
}