Encoding.Clone 方法
定义
public:
virtual System::Object ^ Clone();
public virtual object Clone ();
[System.Runtime.InteropServices.ComVisible(false)]
public virtual object Clone ();
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
[<System.Runtime.InteropServices.ComVisible(false)>]
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
Public Overridable Function Clone () As Object
返回
当前 Encoding 对象的副本。A copy of the current Encoding object.
实现
- 属性
注解
即使原始对象是只读的,克隆也是可写的 Encoding 。The clone is writable even if the original Encoding object is read-only. 因此,可以修改克隆的属性。Therefore, the properties of the clone can be modified.
对象的浅表副本只是对象的副本。A shallow copy of an object is a copy of the object only. 如果对象包含对其他对象的引用,则浅表副本不会创建所引用对象的副本。If the object contains references to other objects, the shallow copy does not create copies of the referred objects. 改为引用原始对象。It refers to the original objects instead. 与此相反,对象的深层副本将创建对象的副本和该对象直接或间接引用的所有内容的副本。In contrast, a deep copy of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object.