Syntax:
void SortedList.Add(object key, object value);
Parameter(s):
- key: Element's key to be stored.
- value: Element's value to be stored.
Return value:
This method does not return any value.
Exception(s):
- System.ArgumentNullException
- System.ArgumentException
- System.NotSupportedExecption
- System.OutOfMemoryException
- System.InvalidOperationException
-
Program:
The source code to add elements into a SortedList is given below. The given program is compiled and executed successfully.
Output: