Because the entire body of the method is a single block, I can define and use local variables within the body without any problems.
因为整个方法是一个块,所以我可以毫无问题地在正文中定义并且使用局部变量。
Variables declared with a method are local to that method and cannot be used outside of it.
方法内部声明的变量是局部变量,在方法外部是不能够使用的。
Static local variables retain their value between method calls.
静态局部变量会在方法调用之间保留它们的值。
The static local variable is interesting because the common language runtime (CLR) does not support static variables inside a method.
静态局部变量之所以非常令人感兴趣,是因为公共语言运行库(CLR)不支持方法内的静态变量。
Often, you have many local variables that are short-lived within a method, but the method itself is invoked repeatedly and frequently.
在方法中常常有许多短期存在的本地变量,但是方法本身会被频繁地反复调用。
Variables declared inside a method are called local variables because they are available only to that method and not to any other parts of the code.
方法主体中声明的变量成为局部变量,它只对该方法有效,代码的其他部分均不可访问它。
Variables declared within a method are said to be local variables.
方法内部声明的变量叫做局部变量。
Variables declared within a method are said to be local variables. What is the significance of the word local in this context?
方法内部声明的变量叫做局部变量。这儿局部的意思是什么?
The _startup method copies this information into local variables and hooks up any necessary event handling, as shown in Figure 7.
_ Startup方法将该信息复制到局部变量并挂钩任何必要的事件处理,如图7所示。
While ByVal parameters are effectively local variables, ByRef variables have to copy their value back to the calling method under all circumstances.
在ByVal参数为本地变量时,ByRef变量必须将自己的值复制回所有环境下的调用方法里。
I find that this actually increases the readability of methods: there is no chance of confusing local variables and instance variables when glancing through a method.
我认为这事实上增加了方法的可读性:即使粗略的浏览一个方法,也不会有混淆局部变量和实例变量的机会。
Pass into the target method as parameters local-scope variables that are read from the extracted code.
将被提取代码段中会读取其值的局部变量作为参数传给新方法。
I find that this actually increases the readability of methods: there is no chance of confusing local variables and instance variables when glancing through a method.
我觉得这实际上增加了方法的可读性:当浏览一个方法时,在局部变量和实例变量之间不会出现令人费解的情况。
If a method only operates on independently synchronized objects, local variables, or non-volatile data members, such as those initialized during construction, then synchronization is not required.
若方法只操作专属的对象、本地变量或无冲突的数据成员(如只在构造时期初始化的数据),那么同步就是不需要的。
Wildcards also have the advantage that they can be used outside of method signatures, as the types of fields, local variables and arrays.
通配符也具有优点,他们能够在方法署名之外使用,作为域、本地变量和数组的类型。
Gets the list of local variables declared in the method body.
取得方法主体中所宣告之区域变数的清单。
Gets a value indicating whether local variables in the method body are initialized to the default values for their types.
取得值,指出方法主体中的区域变数是否初始化为其型别的预设值。
Sets the local variable signature that describes the layout of local variables for the associated dynamic method.
设定区域变数签章,描述关联之动态方法的区域变数配置。
Gets a metadata token for the signature that describes the local variables for the method in metadata.
取得签章的中继资料语汇基元,其描述中继资料中的方法区域变数。
Gets a metadata token for the signature that describes the local variables for the method in metadata.
取得签章的中继资料语汇基元,其描述中继资料中的方法区域变数。
应用推荐