我怎么能叫MemberwiseClone()? [英] How can I call MemberwiseClone()?

查看:153
本文介绍了我怎么能叫MemberwiseClone()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑如何使用 MemberwiseClone()方法。我看了看MSDN中的例子,他们用它线槽这个关键字。

I'm confused about how to use the MemberwiseClone() method. I looked the example in MSDN and they use it trough the this keyword.

为什么我不能直接调用它其他对象的方法,如的GetType()的ToString()?不会出现另一个相关的方法是 ShallowCopy()

Why I can not call it directly as other objects' methods like GetType() or ToString()? Another related method that does not appear is ShallowCopy().

如果他们是Object类为什么不能的一部分'T我看到他们?

If they are part of the Object class why can't I see them?

推荐答案

MemberwiseClone()功能保护,所以你只能通过自己的类型的限定符访问它。

The MemberwiseClone() function is protected, so you can only access it through a qualifier of your own type.

这篇关于我怎么能叫MemberwiseClone()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆