copySelf

copySelf(transient: Boolean): SelfType;

The copySelf method of the Object class creates a new instance of the same type as the receiver, invoking constructor methods if defined, and copies the attributes of the receiver (including the contents of primitive arrays).

References and MemoryAddress attributes are not copied and are initialized to null in the copied object.

See also the Object class copySelfAs method and the cloneSelf and cloneSelfAs methods, which do not invoke constructors.