A context item is an immutable object and contains state.
上下文项是不可变的对象,并包含状态。
They provide a mutable wrapper for otherwise immutable object references.
它们为那些用其他方式不可改变的对象引用提供了一个可改变的包装器。
Because we used a set, we have to use tuple as we can only use an immutable object.
由于使用了集合,因此必须使用元组(tuple),因为只能使用不可修改的对象。
If you have an immutable object, you must set whatever state it will contain in the constructor.
如果您有一个不可变对象,则必须要在构造函数中设置该对象将包含的任何状态。
It provides an immutable object used by sockets for binding, connecting, or as returned values.
其提供一个用于套接字绑定、连接或作为返回值的不变对象。
If you want to change an immutable object, you don't - you create a new object with the changed value and point your reference to it.
如果您想要改变一个不可变对象的话,您不会改变它,而是使用修改后的值来创建一个新的对象,并把您的引用指向它。
There can be no side effects on immutable objects, and caching a reference to an immutable object is always safe from alias problems.
不可变对象上没有副作用,并且缓存不可变对象的引用总是安全的,不会出现别名问题。
If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super. clone need to be modified.
如果一个类只包含基本字段或对不变对象的引用,那么通常不需要修改super .clone返回的对象中的字段。
Public Service Reminder: Making all fields of an object final does not necessarily make the object immutable -- all fields must also be primitive types or references to immutable objects.
PublicServiceReminder:让一个对象的所有字段都为final并不一定使得这个对象不可变 —— 所有的字段还必须是原语类型或是对不可变对象的引用。
Further, for data members that are object references, the referred-to objects must be effectively immutable.
此外,对于对象引用的数据成员,引用的对象必须是有效不可变的。
When used as constructor parameters, the mutable or immutable variables specified will be initialized when an object is instantiated.
当作为构造函数参数时,这些可变或者不可变的变量会在一个对象被实例化的时候被初始化。
In addition, these simple built-in types are immutable, which means you can't change an object's value after the object has been created.
另外,这些简单的内置类型是不可改变的,这意味着:创建对象之后,您无法更改对象的值。
Because BigDecimal objects are immutable, each of these methods produces a new BigDecimal object.
由于BigDecimal对象是不可变的,这些方法中的每一个都会产生新的BigDecimal对象。
An immutable "variable" is declared with the keyword val (think value object).
一个不变的“变量”可以用val关键字来声明(想象一个值对象)。
Really, it's an immutable version of the bytearray object from version 2.5.
实际上,它是版本2.5中bytearray对象的不可修改版本。
These types are immutable, which means that when an integer object is created, its value cannot be changed.
这些类型是不可变的,就是说整数对象一旦创建,其值便不可更改。
One special case where we are forced to deal with the issue of object ownership is with arrays, as arrays cannot be immutable.
一个必须处理对象所有权问题的特殊情况是数组,因为数组不可以是不可变的。
This object is an immutable sequence of integers between 0 and 127, or ASCII-only characters.
此对象是0到127的不可修改的整数序列或纯粹的ASCII字符。
For example, a user is a mutable entity, but you might use an immutable value object to represent the user's address, just changing the address that you point to for the user if he or she moves.
例如,虽然用户是可变实体,但是您可以使用不可变值对象来表示用户的地址,如果用户移动了位置,那么只需为该用户更改您所指向的地址。
A state object is immutable, that is, once it is created it cannot be changed without being destroyed and recreated.
状态对象是不变的,这就是说,一旦它被创建就不能被消出或者重建。
Strings are immutable, which means that no matter what operation you do on a string, you will always produce a new string object, rather than mutating the existing string.
字符串是不可变的,也就是说不管你对字符串做何种操作,你总是创建了一个新的字符串对象,而不是改变了原有的字符串。
You can fix the case above, where the called method modifies an object, by making the class immutable.
你可以修正以上的例子,当被调用方法修改一个对象时,让这个类成为不可变的。
A metadata token is not an immutable metadata object identifier.
中继资料语汇基元并非不变的中继资料物件识别项。
If the value being assigned is an immutable value class, the method returns the object itself, instead of a copy of the class.
如果指派的值是不可变动的实值类别,则方法会传回物件本身,而不是类别的复本。
If the value being assigned is an immutable value class, the method returns the object itself, instead of a copy of the class.
如果指派的值是不可变动的实值类别,则方法会传回物件本身,而不是类别的复本。
应用推荐