---Default capacity is 0; if initialized as an empty sorted list---
0
---Capacity automatically assigned to a list, even if initialized with a single item---
4
---Set the initial capacity of a sorted list by specifying the number in parentheses () when a list is created---
7
---You can set the capacity later in the code, once sorted listed is created---
0
5
---If number of items exceeds the capacity, an exception is thrown ---
Run-time exception (line -1): capacity was less than the current size.
Parameter name: value
Stack Trace:
[System.ArgumentOutOfRangeException: capacity was less than the current size.
Parameter name: value]
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.SortedList`2.set_Capacity(Int32 value)
at Program.Main()