【发布时间】:2011-03-22 20:37:30
【问题描述】:
如果我写课,那么一切都好
class C
{
protected int _attr;
int attr { get { return _attr; } }
}
class CWithSet : C
{
int attr { set { _attr = value; } }
}
但是,如果我写界面
interface I
{
int attr { get; }
}
interface IWithSet : I
{
int attr { set; }
}
然后我有争吵:“'IWithSet.attr' 隐藏继承的成员 'I.attr'。如果要隐藏,请使用 new 关键字。”
如何写,以免收到警告?
【问题讨论】:
标签: c#