C# SortedList Capacity
Description
SortedList Capacity
gets or sets the capacity of a SortedList
object.
Syntax
SortedList.Capacity
has the following syntax.
public virtual int Capacity { get; set; }
Example
using System; //from www . j ava 2 s . c om
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.