具有受保护可视性的成员函数可以由与该成员函数在同一个类中定义或其任何子类中定义的其它任何成员函数调用。
A member function with protected visibility can be invoked by any member function in the class in which it is defined or any subclasses of that class.
将每个测试实例与它要测试的类放在同一个包内,以获得对包成员和保护成员的访问权。
Put each test case in the same package as the class it's testing to gain access to package and protected members.
这意味着类元素的所有的私有成员都将被首先转储,然后依次是被保护的成员和公共的成员。
This means that all the private members of the class element are dumped first, followed by protected and public, respectively.
这种方法的一个有趣的副作用是允许通过闭包访问类的私有成员和受保护成员,这有利于对类执行单元测试。
One interesting side effect of this approach is that it allows us to access private and protected members of a class via a closure, which can be handy for unit testing classes.
不要使用公开的或保护的类成员变量,使用属性。
Do not provide public or protected member variables. Use properties instead.
许多其他扩展性机制(如受保护成员和虚成员)要求类是未密封的。
Many of the other extensibility mechanisms, such as protected and virtual members, require that a class be unsealed.
对步骤2中的程序集中要保护不让部分受信任的调用方使用的特定成员或类应用完全信任这一要求。
Apply a demand for full trust to the specific member or class within the assembly from step 2 that you want protected from partially trusted callers.
考虑一种很好的方式,即采用不具有虚成员或受保护成员的未密封类,向框架提供资源开销少的适用扩展性。
Consider unsealed classes with no virtual or protected members as a great way to provide inexpensive, yet much appreciated, extensibility to a framework.
通过在子类中增加一个静态同步方法来试图保护父类中的静态成员变量是无效的。
It is not effective to add a new static synchronized method in a subclass that attempts to protect static fields declared in a superclass.
与类的成员严格保护能见度是可见的在类中声明它们,和在任何派生类,无论在声明。
Class members with strict protected visibility are visible within the class in which they are declared, and within any descendent class, regardless of where it is declared.
如果显式实现的成员的功能意在由派生类特殊化,则一定要提供具有相同功能的受保护虚拟成员。
Do provide a protected virtual member that offers the same functionality as the explicitly implemented member if the functionality is meant to be specialized by derived classes.
成员是仅用于派生类的实现通常是受保护的。
Members that are intended for use only in the implementation of derived classes are usually protected.
只有在通过派生类类型发生访问时,基类的受保护成员在派生类中才是可访问的。
Theprotected keyword is a member access modifier. A protected member is accessible within its class and by derived class instances.
只有在通过派生类类型发生访问时,基类的受保护成员在派生类中才是可访问的。
Theprotected keyword is a member access modifier. A protected member is accessible within its class and by derived class instances.
应用推荐