Get or set the capacity of a SortedList in CSharp
Description
The following code shows how to get or set the capacity of a SortedList.
Example
using System; /*from www . ja va2 s . com*/
using System.Collections;
class MainClass {
public static void Main() {
SortedList sl = new SortedList();
sl.Add("a", "A");
sl.Add("b", "B");
sl.Add("c", "C");
sl.Add("d", "D");
Console.WriteLine(sl.Capacity);
}
}
The code above generates the following result.