#712 – Accessibility Summary

Namespaces, types, class members, struct member, interface members and enumeration members all have an associated accessibility, dictated by the access modifer included in the member’s declaration.

The possible levels of accessibility are:

  • public – all code can access member
  • private – only code within the same type can access member
  • protected – code within type or subtype can access member
  • internal – code within the same assembly can access member
  • protected internal – code within the same assembly, within the same type, or within a subtype can access member

The type of member dictates which levels of accessibility are allowed:

  • class – can be public or internal  (default is internal)  [can only be public if parent class is public]
  • namespace – always public
  • class members – can be public, private, protected, internal or protected internal  (default is private)
  • struct members – can be public, private, or internal (default is private)
  • interface members – always public
  • enumeration members – always public

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: