Re: arraylist copy




"Joseph
> Thanks! Then what is the difference between CopyTo and Clone? MSDN
> mentioned that clone creates a shallow copy and copyto creates a deep
> copy? Thanks again!
>

A clone makes a copy of the arraylist. While an array is a reference type,
are only the references copied. Any change in a shadow will affect on the
other one as well. Except when it is by instance the removing or adding of a
reference (row), than they grew apart.

A copyto makes a copy of the values in a one dimensional array. Where when
it are objects it is in fact again a shadow of course.

A deep copy makes new copy of all the values and creates a new arraylist
arround those. For that I have never seen a method in Net. You have to do it
yourself. (In my opinion can that be complicated when it is by instance a
jagged array).

I hope this gives some idea's

Cor


.



Relevant Pages

  • Re: arraylist copy
    ... Then what is the difference between CopyTo and Clone? ... > a reference, than they grew apart. ... > A copyto makes a copy of the values in a one dimensional array. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: arraylist copy
    ... Then what is the difference between CopyTo and Clone? ... >reference, than they grew apart. ... >A copyto makes a copy of the values in a one dimensional array. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Newbie Q: Serialization and Me
    ... private / inner class and then use your serialization trick on *that* ... Dim bf As BinaryFormatter = New BinaryFormatter ... I have 2 objects and I want to make a deep copy of one into the ... I effectively want to clone an object into Me. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: super.clone() puzzlement
    ... this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. ... known as shallow clone. ...
    (comp.lang.java.programmer)
  • How deep should a deep copy go? / Is an object that contains value type still a reference type?
    ... I'm implementing the Clone() method through the ICloneable interface ... and don't quite know how deep I need to go for a deep copy. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)