Implements the IList interface using an array whose size is dynamically increased as required.
Example
using System;
using System.Collections;
public class SampleArrayList {
public static void Main()
{
ArrayList m_l = new ArrayList();
m_l.Add("a");
m_l.Add("b");
m_l.Add("c");
m_l.Add(1);
Console.WriteLine(" Count: {0}", m_l.Count);
Console.WriteLine(" Capacity: {0}", m_l.Capacity);
Console.Write( " Elements:" );
PrintElements(m_l);
}
public static void PrintElements(IEnumerable m_l)
{
System.Collections.IEnumerator _enum = m_l.GetEnumerator();
while (_enum.MoveNext())
Console.Write("\t {0}", _enum.Current);
Console.ReadLine ();
}
}