List<> capacity has more items than added.
- by Pete
List <string> ali = new List<string>();
ali.Clear();
ali.Add("apple");
ali.Add("orange");
ali.Add("banana");
ali.Add("cherry");
ali.Add("mango");
ali.Add("plum");
ali.Add("jackfruit");
Console.WriteLine("the List has {0} items in it.",ali.Capacity.ToString());
when I run this the Console displays:
the List has 8 items in it.
I don't understand why its showing a capacity of 8, when I only added 7 items.