If i have a ClassA
public class ClassA
{
public string name;
}
Where Attribute Name is Public ,and it can be modified from Anywhere .
Than i have a ClassB
public class ClassB : ClassA
{
private string name;//But it's not Woking ,name is still public
}
…which Inherit’s ClassA ,but i need at ClassB to make name as Private Field.
So if i create an Object of Type ClassB than ClassB.name cannot be modified .
just don’t publish the field but accessors: