Yes, we can specify the access modifiers for the get and set accessors in a property
internal string myname
This is Ok
1)The access modifier for the accessor must be more restrictive than that of the property.
private is more restrictive than internal.
2)Both get and set accessors cannot have access modifiers in the same property.
private set and private get would be WRONG in the above example.
Asked In: Many Interviews |