隐藏派生类中的基类属性 [英] Hide base class property in derived class
本文介绍了隐藏派生类中的基类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的基础课程
This is my Base class
public class BaseClass
{
public string property1
{
get;
set;
}
public string property2
{
get;
set;
}
public string property3
{
get;
set;
}
}
这是我的派生类
and this is my derived class
public class DerivedClass : BaseClass
{
private override string property3
{
get;
set;
}
}
我想在派生类中隐藏 proerty3 。但我得到这个错误虚拟或抽象成员不能私有
。
我怎么能隐藏基类属性?
提前致谢。
I want to hide proerty3 in derived class. but i am getting this error "virtual or abstract members cannot be private
".
How i can hide the base class property?
Thanks in advance.
推荐答案
请看这里:隐藏继承的属性 [ ^ ]
这篇关于隐藏派生类中的基类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文