C\#에서 foreach 를 사용 하여 hashtable 해시 표를 옮 겨 다 니 는 코드

다음 코드 내용 은 C\#에서 foreach 를 사용 하여 hashtable 해시 표를 옮 겨 다 니 는 코드 로 어린이 들 에 게 도 좋 을 것 입 니 다.
using System;
using System.Collection;
namespace HashSampleApplication1
{
  class Program
  {
    static void Main()
    {
     Hashtable hash = new Hashtable();
        hashtable[1] = "kaka";
        hashtable[2] = "biryani";
        hashtable[13] = "kadai";

     foreach (string key in hash.Keys) 
 {
    Console.WriteLine(key + ‘=’ + hash[key]);
 }
    }

  }
}

좋은 웹페이지 즐겨찾기