Re: Best way to clone an ArrayList?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



ArrayList.Clone();


"Chris Bellini" <chris-hatesspam@xxxxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im
Newsbeitrag news:etOkg8UiFHA.3656@xxxxxxxxxxxxxxxxxxxxxxx
> I was just looking for some opinions on the best way to clone an
> ArrayList object. For example, if class A contains an ArrayList, what
> would be the best way to make a copy of it for class B (but not using
> the class constructors):
>
> class A
> {
> public A()
> {
> // constructor stuff goes here
> }
>
> public void DoStuff()
> {
> ArrayList arrTPB = new ArrayList();
>
> arrTPB.Add("Ricky");
> arrTPB.Add("Julian");
> arrTPB.Add("Bubbles");
>
> // new B object
> B myB = new B();
>
> // copy arrTPB from class A to arrNames of myB
> // ???
> }
> }
>
>
> class B
> {
> public ArrayList arrNames;
>
> public B()
> {
> arrNames = new ArrayList();
> // other constructor stuff goes here
> }
> }
>
> Thanks in advance.
>
>
>
> Chris


.



Relevant Pages

  • Re: Best way to clone an ArrayList?
    ... >I was just looking for some opinions on the best way to clone an ArrayList ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Best way to clone an ArrayList?
    ... I was just looking for some opinions on the best way to clone an ArrayList object. ... // other constructor stuff goes here ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: HME numbering
    ... >if i then clone that drive and put that into another identical box ... >are available and how do i reset it so that the cloned HDD reverts ... Expressed in this posting are my opinions. ... to opinions held by my employer, Sun Microsystems. ...
    (comp.unix.solaris)
  • Re: help on decision about upgrading harddisk
    ... opinions... ... Use GHOST to clone the old drive to the new one. ... No need to reinstall software or anything. ...
    (microsoft.public.windowsxp.general)