using System.Collections.Generic;
public static void Main()
SortedList<int, string> planets;
Console.WriteLine("---Default capacity is 0; if initialized as an empty sorted list---");
planets = new SortedList<int, string>();
Console.WriteLine(planets.Capacity);
Console.WriteLine("---Capacity automatically assigned to a list, even if initialized with a single item---");
planets = new SortedList<int, string>() { { 1, "Mercury" } };
Console.WriteLine(planets.Capacity);
Console.WriteLine("---Set the initial capacity of a sorted list by specifying the number in parentheses () when a list is created---");
planets = new SortedList<int, string>(7);
Console.WriteLine(planets.Capacity);
Console.WriteLine("---You can set the capacity later in the code, once sorted listed is created---");
planets = new SortedList<int, string>();
Console.WriteLine(planets.Capacity);
Console.WriteLine(planets.Capacity);
Console.WriteLine("---If number of items exceeds the capacity, an exception is thrown ---");
planets = new SortedList<int, string>() {