I just want to know what is the actual difference between private and protected internal access specifier. As i know
Visible to own class members: private and protected internal YES
Visible to object of other classes: Both NO
Visible to objects of other classes outside the namespace collection: Both NO
Visible to object of child classes outside the namespace collection: Both NO
If private doing the same as protected internal then why we need the both just one should be enough or not?
protected internalmember is visible to any code in the current assembly or in a derived class in another assembly. In technical words, it’s the logical disjunction ofprotectedandinternal.privatemember is visible only to code in the same class.protected internalis actually the second most permissive access modifier afterpublic.It’s worth noting that
protectedis arguably more permissive thaninternal, since it allows access from code that you have no control over (i.e. other assemblies). Whileinternalallows access from all code in the current assembly, this code is yours and you have control over it!To paraphrase,
protected(andprotected internal) members are part of the public API of your assembly (and should therefore be documented).internalmembers are not.