Protected Internal Access Modifier In C#
In this article I will explain protected internal access modifier in C#.
The protected internal access specifier allows its members to be accessed in any class in the same assembly, including derived classes. However, this access specifier rarely used in C# programming but it becomes important when we want to use the concept of inheritance in the program.
The protected internal accessibility means protected OR internal, not protected AND internal.
// String Variable declared as protected internal
protected internal string name;
public void print()
Console.WriteLine("\nMy name is " + name);
static void Main(string args)
accessmod nam = new accessmod();
Console.Write("Enter your name: ");
// Accepting value in internal variable
nam.name = Console.ReadLine();
The output of following program