All classes, along with their respective attributes and functions, have an access modifier associated with them. An access modifier basically indicates how the respective element will be accessed in the application, both in its own assembly as well as in other assemblies. Collectively, attributes and functions in an application are referred to as class members.
In C#, a class and its class members can acquire the following access modifiers:
- Public: A class or a class member declared as public can be accessed by all classes in the same assembly as well as by classes in different assemblies present in the application.
- Private: A class member declared as private can be accessed only in the same class but not outside it.
- Protected: A class or a class member declared as protected can be accessed inside the class or by classes that inherit from the respective class...