Use of Accessibility Modifiers
C# provides facilities for full control over who can see and use classes and class members. This is done through class accessibility modifiers. Proper use of accessibility modifiers can protect the implementation of code and help to provide a clean interface.
For instance, a class may have a private field and provide a public accessor to external users, who have no need to know the nature of that field or how you use it. Furthermore, this practice enables the option to change the nature of that field later on, without causing the external user's code to break.
Accessibility modifiers also allow management of user interfaces. They can be used to expose certain class members to users who assist them in using a class ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access