Hence, the IBM Database Add-ins supports the ability to clone an object definition.
因此,IBMDatabaseAdd - ins支持克隆对象定义。
Because clone has protected access in Object and, to call clone , you have to call it through a reference to a class that has overridden clone to be public.
因为clone在Object中是保护访问的,调用clone必须通过将clone改写公共访问的类引用来完成。
How can write method act similar to clone method of object?
如何写方法的行为类似于对象的克隆方法?
Clones the object original and returns the clone.
克隆原始物体并返回克隆物体。
Therefore when you make a change in the data member object, the original and the clone will be both changed.
因此,当你修改这个对象中的一个数据成员时,原始的和克隆的数据成员都会被改变。
This creates a complete copy of the current binding element object tree, also called a deep clone.
这将创建当前绑定元素对象树的完整副本,也称为深层克隆。
A shallow clone of an object, by contrast, is a copy of the object only.
相比之下,对象的浅表克隆只是对象本身的副本。
A deep clone of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object.
对象的深层克隆创建对象的副本以及该对象直接或间接引用的所有内容的副本。
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返回的对象中的字段。
A shallow clone of an object is a copy of the object only.
对象的浅表克隆只是对象本身的副本。
To achieve this independence, it may be necessary to modify one or more fields of the object returned by super. clone before returning it.
要获得此独立性,在super . clone返回对象之前,有必要对该对象的一个或多个字段进行修改。
To achieve this independence, it may be necessary to modify one or more fields of the object returned by super. clone before returning it.
要获得此独立性,在super . clone返回对象之前,有必要对该对象的一个或多个字段进行修改。
应用推荐