不可变数据是许多侧重于并发性的语言的关键方面,因为它有如此好的属性。
Immutable data is a key aspect of many languages that focus on concurrency because it has such nice properties.
列举型别可视为是资料型别,您可以用来建立多组常数以便与变数和属性搭配使用。
Enumerations are treated as data types, and you can use them to create sets of constants for use with variables and properties.
下表会显示变数和属性间的一些重要差异点。
The following table shows some important differences between variables and properties.
用户端程序码是使用这些变数呼叫方法并存取物件之公用属性的程序码。
Client code is the code that USES these variables to call the methods and access the public properties of the object.
变数和属性都代表可存取的值。
Variables and properties both represent values that you can access.
属性值会如同变数或常数参与运算式的方式参与运算式,或是储存于指派陈述式左边的变数或属性中。
The value of the property participates in the expression just as a variable or constant would, or it is stored in the variable or property on the left side of the assignment statement.
类别中的变数栏位与全域或函式变数类似,但它只能在类别范围中作用,而且可以具有控制可视性与用法的不同属性。
A variable field in a class is similar to a global or function variable, except that it is scoped to the class and it can have various attributes governing its visibility and usage.
类别中的变数栏位与全域或函式变数类似,但它只能在类别范围中作用,而且可以具有控制可视性与用法的不同属性。
A variable field in a class is similar to a global or function variable, except that it is scoped to the class and it can have various attributes governing its visibility and usage.
应用推荐