Internal & Protected Internal
Can any one explain to me c# access specifiers Internal & Protected Internal with example?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jun 15, 2011, 4:39 AM
First compile the following as a dll called testdll.dll:
The CLR also has the concept of 'protected AND internal' which means that the member is only accessible from within its class or within a derived class in the same assembly. It's never accessible from a different assembly.
However, neither C# nor VB.Net supports protected AND internal (however C++/CLI and CIL do) so this is academic unless you're using reflection to create a class dynamically.
Gomathi PalaniswamyPosted Jun 15, 2011, 3:21 AM
Internal - The internal can be accessed from same name assembly but not by some other assembly like public.
Protected internal - The protected internal can be accessed by same assembly and derived assembly.
Mayur GujrathiPosted Jun 15, 2011, 2:53 AM