Tuesday, February 23, 2010

Which access modifiers can be applied to a class in the .NET Framework?

The following access modifiers can be applied to classes. These modifiers determine which classes in the object hierarchy can use the class.
  • public The class can be accessed from any assembly
  • private The class can only be referenced from within the same class
  • protected The class can be accessed from the same class or any descendant of the class
  • internal The class can be accessed from any class within the same assembly
Additional Resources
C# Class Access Modifiers (Microsoft)
VB.NET Access Modifiers (Microsoft) 

No comments:

Post a Comment