protected到下一个权限关键字之间的成员称为保护成员 (protected member),保护成员可以在类体中使用,也可以 在派生类中使用,但不能在其他类外通过对象使用。
基于12个网页-相关网页
Do not provide public or protected member variables. Use properties instead.
不要使用公开的或保护的类成员变量,使用属性。
Private and protected member variables are shown only in Expert Mode. Properties are not serialized or shown in the inspector.
私有和保护变量只能在专家模式中显示。属性不被序列化或显示在检视面板。
Theprotected keyword is a member access modifier. A protected member is accessible within its class and by derived class instances.
只有在通过派生类类型发生访问时,基类的受保护成员在派生类中才是可访问的。
应用推荐