Private function can access private variables.
这说明私有函数能访问私有变量。
Why can't this friend function access the private variables?
为什么这不可以友元函数访问私有变量?
Let's see an example of where some private variables will be useful. Consider this subroutine.
如下示例展示私有变量在哪里会很有用。
Loops and such constructs do not open a new scope, so there is no way to create private variables within them.
这种循环和建构不打开一个新的范围,所以是没有出路的创造私人变数。
Instead, I create the class and quickly type the private variables I'll be using in the class, like those in Listing 1.
相反,我创建类并快速在类中输入私有变量,如清单1所示。
Tapestry must perform runtime class modifications to support instance variables, and may only do so for private variables.
Tapestry必须执行运行时类的修改来支持实例变量,并且只对私有变量。
You may have non-private variables in your class, but you may then see unexpected behavior in a production application because of how Tapestry pools and reuses pages and components.
在你的类中可以有非私有的变量,但是这样你就会在你的程序中看到不可预料的异常行为,这是因为Tapestry对页面和组件的缓冲和重用。
This means that every session can use the global variables that exist in the catalogs, but each session has its own private value that it can manipulate and use.
这意味着每个会话都可以使用编目中保存的全局变量,但是每个会话拥有自己的私有值来操作和使用。
That is, in C++, objects of the same class cannot see one another's private member variables.
也就是说,在 C++ 中,同一个类的对象无法看到彼此的私有成员变量。
A nested, or inner, function can inherit the arguments and variables of its outer function, and is private to that function.
一个嵌套的内部函数可以继承外部函数的参数和变量,并由该外部函数私有。
Not only are the variables private but they are private to the particular instance of the Converter class.
这些变量不仅是私有的,而且只属于converter类的特定实例。
The first and most important addition was access protection for methods and instance variables on classes -- the public, protected, and private keywords.
第一个也是最重要的新特性是针对类的方法和实例变量的访问保护 ——public、protected 和private 关键字。
In the same vein, assert is also used to test the internal state of a function-such as private member variables, or variables with internal linkage used strictly within the file.
同理,断言也被用来测试函数的内部状态,比如说私有成员变量或者文件的内部变量(variableswith inner -linkage usedstrictlywithinthe file .)。
Sometimes the code is very obviously unreachable (uncalled private methods, unread local variables, and so forth).
有时候,这些代码是明显不可达的(未调用的私有方法以及未读入的本地变量,等等)。
The Book class is then defined, with private member variables for each field.
然后定义book类,用私有成员变量代表每个字段。
Using closures designed primarily to private methods and variables.
使用闭包主要是为了设计私有的方法和变量。
But the study isolated race as a factor by controlling for variables like academic performance, legacy status, social class, type of high school (public or private) and participation in athletics.
但那项研究通过控制学业成绩、遗产地位、社会阶层、高中类型(公立或私立)、参与体育运动等变量,将种族作为一个孤立的因素。
You should not use your instance constructors, some special private function, or any other idiom to initialize static variables.
不应该使用实例构造函数、一些特殊的私有方法、任何其它习惯来初始化静态变量。
Generally, you should use fields only for variables that have private or protected accessibility.
通常应仅为具有私有或受保护可访问性的变量使用字段。
Private and protected member variables are shown only in Expert Mode. Properties are not serialized or shown in the inspector.
私有和保护变量只能在专家模式中显示。属性不被序列化或显示在检视面板。
Can have private components, session variables, etc.
可以有专用组件,会话变量等。
The best way to protect data in memory is to declare the data as private or internal (with scope limited to the same assembly) variables.
保护内存中的数据的最好方法就是,将数据声明为私有或内部(范围限定为相同的程序集内)变量。
Example 8-6 is a second closure example. It demonstrates that private persistent variables like the one used above can be Shared by more than one function.
示例8 - 6是第二个闭包示例。它演示了像上面那样私有保存的值可以被不止一个函数访问到。
Only member variables are serialized and are shown in the inspector. Private and protected member variables are shown only in Expert Mode. Properties are not serialized or shown in the inspector.
只有序列化的成员变量才能显示在检视面板,私有和保护变量只能在专家模式中显示。属性不被序列化或显示在检视面板。
The features you use in the definitions of your private classes, in the definitions of private methods on public classes, and in local variables do not have to follow the CLS rules.
在私用类别的定义中、在公用类别之私用方法上的定义中,以及在区域变数中使用的功能不用遵循CLS规则。
If it can be declared private then it should be declared that way. That applies to procedures, functions and variables.
如果是私有范围的,请声明为私有,不管是过程、函数,还是变量。
If it can be declared private then it should be declared that way. That applies to procedures, functions and variables.
如果是私有范围的,请声明为私有,不管是过程、函数,还是变量。
应用推荐