Completely Free .NET word API

Forums » .NET » .NET »

Differnce between internal & protected internal access specifier ?

Posted Date: 19 Feb 2009      Posted By:: venkatesh vadde     Member Level: Silver  Member Rank: 0     Points: 1   Responses: 2

mmm...I may be confussed, but this is what I understand...

protected -> the class itself and any inheriting class can access this method or propetry

internal -> ANY class within same assembly can access this method/property, meaning any class within the same VS Project, exe, or dll can access it, whether it's inheriting it or not can get to it

protected internal -> the class itself (where it's declared), the inheriting class(es), and just like internal, it can be access throughout our assemby by any class or part of assembly

based on the above, what is the real need for "protected internal"? If I want a method to be accessible by the base class, all inheriting classes, and throughout the assembly as well, then I can just declare it internal, why dcelare it protected internal? what does it gain me, other than the extra keyword?


#348899    Author: Kartheek Reddy .N       Member Level: Silver      Member Rank: 0     Date: 19/Feb/2009   Rating: 2 out of 52 out of 5     Points: 2

check this this might help

and I doubt u have already seen it

Kartheek Reddy .N / GGK Technologies Inc –

#348978    Author: Deepthi      Member Level: Bronze      Member Rank: 0     Date: 19/Feb/2009   Rating: 2 out of 52 out of 5     Points: 4


Let me Share one single point on this...

What you say is correct, when you are thinking of in one particular Assembly But the scenario changes with multiple assemblies.

Answer to your Point: what is the Need for protected internal?

Let me describe the scenario.

I have a classBase with somemethod which is needed in myAssembly,
and in someclasses of other other Assemblies which inherits the Base class
--> then what is the Access we have for Some Method() in order to access it in MyAssembly and OtherAssemly
Post Reply     

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.

  • Return to Discussion Forum
  • Start new thread

  • Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India