#307 – Internal Class Members

Class members marked with the accessibility keyword internal are accessible from within the same class, or from within the code of any classes that exist in the same assembly.

In the picture below, the Dog.DoBark method is marked as internal.  The code in any of the blue blocks can call this method.

Notice that code in the Shepherd class cannot call DoBark, even though it’s in a subclass of Dog.  Also notice that code in OtherClass can call DoBark, even though it’s not a subclass of Dog.  Only code in the same assembly as the Dog class has access to the DoBark method.

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 43 other followers