Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
Access modifiers are keywords used to specify the declared accessibility of a member or a type. This section introduces the five access modifiers:
publicprotectedinternalprivatefile
The following seven accessibility levels can be specified using the access modifiers:
public: Access isn't restricted.protected: Access is limited to the containing class or types derived from the containing class.internal: Access is limited to the current assembly.protected internal: Access is limited to the current assembly or types derived from the containing class.private: Access is limited to the containing type.private protected: Access is limited to the containing class or types derived from the containing class within the current assembly.file: The declared type is only visible in the current source file. File scoped types are generally used for source generators.
This section also introduces the following concepts:
- Accessibility Levels: Using the access modifiers to declare levels of accessibility.
- Accessibility Domain: Specifies where, in the program sections, a member can be referenced.
- Restrictions on Using Accessibility Levels: A summary of the restrictions on using declared accessibility levels.
See also
Vertu í samstarfi við okkur á GitHub
Heimildina fyrir þetta efni er að finna á GitHub, þar sem þú getur líka búið til og farið yfir vandamál og sameinað beiðnir. Frekari upplýsingar er að finna í framlagshandbók okkar.