Is this possible to preventing access public member (such as method, variable etc.) of base class from derived class instance? For example;
public class BaseClass
{
public int m_a;
}
public class DerivedClass : BaseClass
{
base.m_a = 10; //good
}
but, I don't want to this;
DerivedClass dc = new DerivedClass();
dc.m_a = 20; //not good
Is that possible?
protected means the derived class can access it, however, the derived class can access the property of it's own instance also.