diff b/w shaloow copy and deep copy - DOTNET

This is a discussion on diff b/w shaloow copy and deep copy - DOTNET ; hello can anybody explain diffrence between shaloow copy and deep copy in c#...

+ Reply to Thread
Results 1 to 3 of 3

diff b/w shaloow copy and deep copy

  1. Default diff b/w shaloow copy and deep copy

    hello can anybody explain diffrence between shaloow copy and deep copy in c#

  2. Default Re: diff b/w shaloow copy and deep copy


    "sujith" <sujith@discussions.microsoft.com> wrote in message
    news:8B187B49-60AA-46B0-BDD0-81E2433EB38C@microsoft.com...
    > 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.


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



  3. Default Re: diff b/w shaloow copy and deep copy


    Thanks

+ Reply to Thread

Similar Threads

  1. Copy List Item activity in SharePoint designer doesn't copy lookup
    By Application Development in forum Sharepoint
    Replies: 2
    Last Post: 08-17-2009, 03:44 PM
  2. deep copy of a polymorphic object with only a base ptr?
    By Application Development in forum c++
    Replies: 3
    Last Post: 08-20-2007, 07:02 AM
  3. Deep Copy and '='
    By Application Development in forum CSharp
    Replies: 2
    Last Post: 08-14-2007, 12:36 PM
  4. Fast deep copy
    By Application Development in forum Java
    Replies: 6
    Last Post: 07-21-2007, 06:04 AM
  5. "deep copy" with VisualWorks?
    By Application Development in forum Smalltalk
    Replies: 7
    Last Post: 03-02-2006, 08:00 PM