using System.Collections;
public class Example
{
public static void Main()
{
// ArrayList 생성
ArrayList arrayList = new ArrayList();
arrayList.Add("Hello");
arrayList.Add("CodeKiller");
arrayList.Add("^^");
// ArrayList 의 속성 출력.
Console.WriteLine("arrayList");
Console.WriteLine(" Count: {0}", arrayList.Count);
Console.WriteLine(" Capacity: {0}", arrayList.Capacity);
Console.Write(" Values:");
PrintArrayListValues(arrayList);
}
public static void PrintArrayListValues(IEnumerable myList)
{
foreach (Object obj in myList)
Console.Write(" {0}", obj);
Console.WriteLine();
}
}