static void Main() { ArrayList col = MyArrayList.NewCollection(5); MyArrayList.PrintMyCollection(col); MyArrayList.AddElementMyCollection(10, ref col); MyArrayList.PrintMyCollection(col); MyArrayList.RemoveElementMyCollection(5, 1, ref col); MyArrayList.PrintMyCollection(col); Console.ReadKey(); }
static void Main(string[] args) { MyArrayList list = new MyArrayList(5); for (int i = 0; i < 30; i++) { list.Add(i); list.Count(); Console.WriteLine("--------"); } Console.ReadKey(); }
static void Main(string[] args) { MyArrayList <int>[] test = new MyArrayList <int> [4]; test.Add(1); test.Add(2); test.Add(3); test.Add(4); test.Add(5); int[] CustomRange = { 6, 7, 8, 9, 10 }; test.AddRange(CustomRange); foreach (var item in test) { Console.WriteLine(item); } }