An Internal class is a class which cannot be used outside its Assembly. The internal keyword is used to mark a particular class Internal i.e. it restrict its access outside the Assembly.
• An Assembly could be a Project, a DLL or an EXE.
• Inside the Assembly, the internal class is like public class.
• An internal class can be inherited within the Assembly.
Example:
internal class A
{
public void Fun()
{
}
}
//Valid
public class B : A
{
public static void Fun()
{
}
}
public class C
{
public static void Fun()
{
//Valid
A a = new A();
a.Fun();
}
}