Събитие
Създаване на интелигентни приложения
17.03, 21 ч. - 21.03, 10 ч.
Присъединете се към поредицата срещи, за да изградите мащабируеми AI решения, базирани на реални случаи на употреба с колеги разработчици и експерти.
Регистрирайте се сегаТози браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
A member access modifier that specifies that one or more declared programming elements are accessible only from within their own class or from a derived class.
Sometimes a programming element declared in a class contains sensitive data or restricted code, and you want to limit access to the element. However, if the class is inheritable and you expect a hierarchy of derived classes, it might be necessary for these derived classes to access the data or code. In such a case, you want the element to be accessible both from the base class and from all derived classes. To limit access to an element in this manner, you can declare it with Protected
.
Бележка
The Protected
access modifier can be combined with two other modifiers:
Declaration Context. You can use Protected
only at the class level. This means the declaration context for a Protected
element must be a class, and cannot be a source file, namespace, interface, module, structure, or procedure.
Access Level. All code in a class can access its elements. Code in any class that derives from a base class can access all the Protected
elements of the base class. This is true for all generations of derivation. This means that a class can access Protected
elements of the base class of the base class, and so on.
Protected access is not a superset or subset of friend access.
Access Modifiers. The keywords that specify access level are called access modifiers. For a comparison of the access modifiers, see Access levels in Visual Basic.
The Protected
modifier can be used in these contexts:
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка:
Събитие
Създаване на интелигентни приложения
17.03, 21 ч. - 21.03, 10 ч.
Присъединете се към поредицата срещи, за да изградите мащабируеми AI решения, базирани на реални случаи на употреба с колеги разработчици и експерти.
Регистрирайте се сега