Access Modifiers

In this lesson, we will learn about the access modifiers and how to use them in our C# code.

In C#, we can impose access restrictions on different data members and member functions. The restrictions are specified through access modifiers. Access modifiers are tags we can associate with each member of the class to define which of its parts can be accessed by the program/application directly.

Types of Access Modifiers

There are the following six types of access modifiers in C#:

  1. private
  2. public
  3. protected
  4. internal
...