Alex Rivera | Logout

How can I call MemberwiseClone()?

Asked 2011-05-19T23:38:28.613
11

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

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

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

Edit
Report

1 Answer

15

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

answered 2011-05-19T23:40:34.947

Your Answer