cpp C++/CLI .NET 2.0if (pets->ContainsKey("joe")) Console::WriteLine(pets["joe"]);
using namespace System;
using namespace System::Collections;
int main()
{
Hashtable^ pets = gcnew Hashtable;
pets->Add("joe", "cat");
pets->Add("mary", "turtle");
pets->Add("bill", "canary");
if (pets->ContainsKey("joe")) Console::WriteLine(pets["joe"]);
}