The protected internal access specifier allows a class to hide its member variables and member functions from other class objects and functions, except a child class within the same application.
In the below example, the derived class object can access the protected internal variable.
Example
using System;
class One {
protected internal int a = 50;
private int b;
}
class Two : One {
public Two() {
Console.WriteLine(this.a);
}
}
class Demo {
static void Main() {
Two t = new Two();
// allowed since it is a derived class object
t.a = 20;
}
}Output
50