private void Test01() { int[] arr1 = { 1, 2, 3, 4, 5, 6 }; ArrayList arr2 = new ArrayList() { 1, 2, 3, 4, 5, 6, 7 }; int[] arr3 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; MyReadOnlyList myReadOnlyList = new MyReadOnlyList(arr3); Console.WriteLine(Sum(arr1)); Console.WriteLine(Sum(arr2)); Console.WriteLine(Sum(arr3)); //Console.WriteLine(Sum(myReadOnlyList)); }
public MyEnumerator(MyReadOnlyList myReadOnlyList) { _myReadOnlyList = myReadOnlyList; }