对ArrayList 进行深拷贝
ArrayList arr = new ArrayList(); arr.Add(new People("A", 10)); arr.Add(new People("B", 20)); arr.Add(new People("C", 30)); ArrayList arr2 = new ArrayList(); foreach (People p in arr) { arr2.Add(p.Clone()); }
ArrayList arr = new ArrayList(); arr.Add(new People("A", 10)); arr.Add(new People("B", 20)); arr.Add(new People("C", 30)); ArrayList arr2 = new ArrayList(); foreach (People p in arr) { arr2.Add(p.Clone()); }