What is the difference between ‘protected’ and ‘protected internal’?
There are the following difference between “protected” and “protected internal”.
Protected members can be accessed only by code in the same class, or in a class that is derived from that class.
Note: Protected members are not accessible using the object in the derived class.
Protected Internal member can be accessed by any code in the assembly in which it’s declared, or from within a derived class in another assembly.
Note: Protected Internal member works as Internal within the same assembly and works as Protected for outside the assembly.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
There are the following difference between “protected” and “protected internal”.
Protected Member:
Protected members can be accessed only by code in the same class, or in a class that is derived from that class.
Note: Protected members are not accessible using the object in the derived class.
Protected Internal:
Protected Internal member can be accessed by any code in the assembly in which it’s declared, or from within a derived class in another assembly.
Note: Protected Internal member works as Internal within the same assembly and works as Protected for outside the assembly.
need an explanation for this answer? contact us directly to get an explanation for this answer