I have ClassLibrary project in C# and all my 'private classes' (under different namespace) are accessible to each other inside the same assembly (project).
Class1.cs
----------------------------
namespace MyClass1App
{
private class Class1{}
}
Class2.cs
----------------------------
namespace MyClass2App
{
private class Class2{}
}
Now Class1() can access and create instance of Class2() class [like... new MyClass2App.Class2() ]. and yes, these classes (Class1() and Class2()) are not accessible outside the assembly. Its the same behavior when these classes are made as 'Internal'. Can someone help me understanding whats the actual use/difference of 'private' and 'internal' access specifiers when applied on class level?
Thanks!
For normal classes you can only apply public
and internal
other access modifiers don't make sense.
Nested classes can have all access modifiers types.