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:
List1: 1 : India 2 : Australia 3 : Africa 4 : Canada 5 : America List2: 1 : MP 2 : HP 3 : AP 4 : UP Press any key to continue . . .
need an explanation for this answer? contact us directly to get an explanation for this answer