Skip to content

Instantly share code, notes, and snippets.

@tnngo2
Created April 24, 2012 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnngo2/2477763 to your computer and use it in GitHub Desktop.
Save tnngo2/2477763 to your computer and use it in GitHub Desktop.
class ArrayCollection
{
static void Main1(string[] args)
{
ArrayList objArray = new ArrayList(1);
objArray.Add("John");
objArray.Add("James");
objArray.Add("Peter");
objArray.Add("Peter");
objArray.RemoveAt(2);
objArray.Insert(2,"William");
Console.WriteLine("Capacity : " + objArray.Capacity);
Console.WriteLine("Count : " + objArray.Count);
Console.WriteLine();
Console.WriteLine("Elements of the ArrayList");
foreach (string str in objArray)
{
Console.WriteLine(str);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment