TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rich
NA
84
61.2k
Deep Copy
Jul 17 2012 5:39 AM
I am just learning about Deep Copy, and I am a little confused.
public Class Person
{
public string Position {get;set;}
public Tools ToolData {get;set;}
public GPS GpsData {get;set;}
public Person DeepCopy()
{
Person copy = (Person)
this
.MemberwiseClone();
}
}
Does the above code truly create a deep copy of all the properties in the class or am I missing a step, such as something like adding this to the code:
copy.ToolData = this.ToolData;
copy.GpsData = this.GpsData;
I want to make sure that I an truly creating a new independent object from which it was copied from.
Reply
Answers (
1
)
Want to create URL rewrite based on User Id and Password.
how to accpet 5 record of student & calculate percentage in array(in c#.net)