- In this article we will explain how to use internal modifier or specifier in c# or What internal modifier or why use internal modifier in c# or how to hides variables and methods to accessing another namespace or Application in c# with example.
The internal keyword is used to specify the internal access specifier for the variables and functions. Its hide member variables and methods from other classes and objects, that is resides in other namespace. The variable or classes that are declared with internal can be access by any member within same application or assembly. It is the default access specifiers for a class in C# programming.
- Let's see a simple Example of internal modifier
internal string designation = "Software Developer";
internal void GetUser()
Console.WriteLine("Name : Aditya Kumar Patel");
static void Main(string args)
User User = new User();
//Accessing internal function
//Accessing internal variable
Console.WriteLine("Designation :" + User.designation);
I hope this article will help to you.