C# ListDictionary ListDictionary()
Description
ListDictionary ListDictionary()
creates an empty ListDictionary
using the default comparer.
Syntax
ListDictionary.ListDictionary()
has the following syntax.
public ListDictionary()
Example
using System;/*from www . jav a2 s . c om*/
using System.Collections;
using System.Collections.Specialized;
public class SamplesListDictionary {
public static void Main() {
ListDictionary myCol = new ListDictionary();
myCol.Add( "F", "1.49" );
myCol.Add( "A", "1.29" );
myCol.Add( "B", "1.49" );
myCol.Add( "C", "1.29" );
myCol.Add( "D", "0.89" );
myCol.Add( "E", "0.99" );
foreach ( DictionaryEntry de in myCol )
Console.WriteLine( " {0,-25} {1}", de.Key, de.Value );
}
}
The code above generates the following result.