Access modifier | Access level granted | Elements you can declare with this access level | Declaration context within which you can use this modifier |
Public | Unrestricted: Any code that can see a public element can access it | Interfaces Modules Classes Structures Structure members Procedures Properties Member variables Constants Enumerations Events External declarations Delegates | Source file Namespace Interface Module Class Structure |
Protected | Derivational: Code in the class that declares a protected element, or a class derived from it, can access the element | Interfaces Classes Structures Procedures Properties Member variables Constants Enumerations Events External declarations Delegates | Class |
Friend | Assembly: Code in the assembly that declares a friend element can access it | Interfaces Modules Classes Structures Structure members Procedures Properties Member variables Constants Enumerations Events External declarations Delegates | Source file Namespace Interface Module Class Structure |
ProtectedFriend | Code in the same class or the same assembly as a protected friend element, or within any class derived from the element's class, can access it | Interfaces Classes Structures Procedures Properties Member variables Constants Enumerations Events External declarations Delegates | Class |
Private | Declaration context: Code in the type that declares a private element, including code within contained types, can access the element | Interfaces Classes Structures Structure members Procedures Properties Member variables Constants Enumerations Events External declarations Delegates | |






















No comments:
Post a Comment