The following is an example of the use of the internal access specifier:
private string CarColor; //since the variable is private, it cannot be accessed outside the class defination.
internal void Honk()
internal string BikeColor; // since the variable is internal, it can be accessed outside the class defination.
static void Main(string args)
Car Ford = new Car();
Bike Honda = new Bike();
//Ford.CarColor = "red"; //Error! cannot access private members.
Honda.BikeColor = "Blue";
Ford.Honk(); // Displays BEEP BEEP!
Note: The CarColor variable cannot be accessed from any function outside the car class. On the other hand, the BikeColor variable is an internal member. Hence, it can be accessed from outside the class. Also, the Honk() function will be accessible from anywhere in the program and can be accessed by using the objects of the Car class.
C Sharp Access specifier Related Contents.
Understanding the public Access specifier in c#:
Understanding The private access specifier in c Sharp.
Understanding The protected access specifier in c Sharp.
understanding the protected internal Access Specifier in c#:
if...else construct in c sharp.