C# HybridDictionary Add

Description

HybridDictionary Add adds an entry with the specified key and value into the HybridDictionary.

Syntax

HybridDictionary.Add has the following syntax.


public void Add(
  Object key,
  Object value
)

Parameters

HybridDictionary.Add has the following parameters.

  • key - The key of the entry to add.
  • value - The value of the entry to add. The value can be null.

Returns

HybridDictionary.Add method returns

Example


using System;//from   w w  w  . j a  va 2  s . co  m
using System.Collections;
using System.Collections.Specialized;

public class SamplesHybridDictionary  {

   public static void Main()  {
      HybridDictionary myCol = new HybridDictionary();
      myCol.Add( "F", "1.49" );
      myCol.Add( "A", "1.29" );
      myCol.Add( "B", "1.49" );

      foreach ( DictionaryEntry de in myCol )
         Console.WriteLine( "   {0,-25} {1}", de.Key, de.Value );
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections.Specialized »




BitVector32
HybridDictionary
ListDictionary
OrderedDictionary
StringCollection
StringDictionary
StringEnumerator