我有这个基类:
abstract class Base
{
public int x
{
get { throw new NotImplementedException(); }
}
}
Run Code Online (Sandbox Code Playgroud)
以下的后代:
class Derived : Base
{
public int x
{
get { //Actual Implementaion }
}
}
Run Code Online (Sandbox Code Playgroud)
当我编译时,我得到这个警告,说Derived类的定义x是要隐藏Base的版本.是否可以覆盖c#like方法中的属性?