Passing ArrayList To A Class In Foreach Loop
Posted on 2006-11-02
I am attempting to pass an ArrayList to a class, inside of a foreach loop. Each ArrayList is unique going in, however, after the loop, all ArrayLists have the same values.
I am doing:
foreach(myclass tempClass in myClassArrayList)
ArrayList bla = tempClass.GetArrayList();
//play around with bla, get it how it should be for this instance
//at this point bla is unique
//after this foreach, all myclass's in myClassArrayList have the same .GetArrayList() values, yet maintain different hash codes.
this.myClassesArrayList = new ArrayList(incoming);