Created
April 24, 2012 08:10
-
-
Save tnngo2/2477763 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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