using
System;
using
System.Collections;
using
System.Collections.Specialized;
class
GFG {
public
static
void
Main()
{
ListDictionary myDict =
new
ListDictionary();
myDict.Add(
"Australia"
,
"Canberra"
);
myDict.Add(
"Belgium"
,
"Brussels"
);
myDict.Add(
"Netherlands"
,
"Amsterdam"
);
myDict.Add(
"China"
,
"Beijing"
);
myDict.Add(
"Russia"
,
"Moscow"
);
myDict.Add(
"India"
,
"New Delhi"
);
DictionaryEntry[] myArr =
new
DictionaryEntry[myDict.Count];
myDict.CopyTo(myArr, -2);
for
(
int
i = 0; i < myArr.Length; i++) {
Console.WriteLine(myArr[i].Key +
"-->"
+ myArr[i].Value);
}
}
}