ArrayList list = new ArrayList(); list.Add(10); list.Add(20); list.Add(30); list.RemoveAt(1); // removes the element at index 1 (which is 20) foreach (object obj in list) { Console.WriteLine(obj); }
10 30In the above example, we create an `ArrayList` instance and add three integers (10, 20, 30) using the `Add` method. Then, we remove the element at index 1 using the `RemoveAt` method. Finally, we loop through the remaining elements in the `ArrayList` and print them to the console. This method belongs to the `System.Collections` package library.