Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

diff b/w shaloow copy and deep copy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sujith - 20 Feb 2007 06:35 GMT
hello can anybody explain diffrence between  shaloow copy and deep copy in c#
pvdg42 - 20 Feb 2007 15:09 GMT
> hello can anybody explain diffrence between  shaloow copy and deep copy in
> c#

This applies, not just to C#, but to any language that employs "reference
types".

When copying an object, a shallow copy makes copies of the contents of
fields as defined in the class definition. If one or more of the fields is a
reference type (holds the address where the actual data is stored), then it
is the address that is copied. You end up with multiple references to the
same data.
When you write a method to perform a "deep copy", you don't just copy the
addresses stored in reference type fields, you retrieve the actual data and
make a copy of the data at a new location, thus making the new copied object
fully independent of the original object.

Signature

Peter [MVP Visual Developer]
Jack of all trades, master of none.

sujith - 21 Feb 2007 15:05 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.