What protected internal access modifier
Define protected internal access modifier in c# and how it is differ from internal access modifier.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 22, 2012, 6:50 AM EDT
==>Accessible anywhere in same assembly it is created + Sub classes in other assembly.
Check this is correct answer if it helped.
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 22, 2012, 6:58 AM EDT
Protected- you can access it in child classes.
So protected internal will be a combination of both. You can access within the same assembly as well as child classes present inside other assembly.
Let me tell you smalll example.
I have assembly1, assembly2
In assembly1 i have a parent Class Vehicle.
In the same assembly i have a class Car derived from vehicle.
Now in assembly2 , i have class Bus derived from vehicle(Assembly1).
Now if i have 2 methods CalculateMileage, GetFuelCapacity
Calculate Mileage i declared it as internal access specifier and GetFuelCapacity i declared it as protectedinternal.
Now when i check the methods for Bus, i can see only GetFuelCapacity, thats because its declared as protected internal.
Hope this would help you to understand well..
VulpesRank #55 · 29.2K reputationPosted Sep 22, 2012, 2:03 PM EDT
I believe there were two reasons for this:
1. The language designers didn't think it would be used much, if at all.
2. They couldn't think of a suitable name for it anyway :)
However, it is supported in C++/CLI ( as 'protected private') for anyone who uses that language.