C# ListDictionary Item

Description

ListDictionary Item gets or sets the value associated with the specified key.

Syntax

ListDictionary.Item has the following syntax.


public Object this[
  Object key
] { get; set; }

Parameters

ListDictionary.Item has the following parameters.

  • key - The key whose value to get or set.

Example


using System;// w ww  .  j a  v a 2s.c o m
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" );

      Console.WriteLine(myCol[1]);
   }
}




















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




BitVector32
HybridDictionary
ListDictionary
OrderedDictionary
StringCollection
StringDictionary
StringEnumerator