Hashtables - Item Method

SEVI

Freshman
Joined
Jun 28, 2003
Messages
48
Location
Australia
Question: Does the hashtable class have an item method?

All documentation says it should. MSDN says it should, other sources confirm this. But I have not been able to use it, becuase it does not seem to be there !!

As I understand it I should be able to just create a hashtable and the method should be available as a member of h, below..

System.Collections.Hashtable h = new System.Collections.Hashtable();

I'm using C# 2003 and cannot fingure out what is going on. Can anyone shed some light on this?

Thanks
 
C#:
using System.Collections;

Hashtable h = new Hashtable();

h.Add(key, value);
object o = h[key];

Should work.
 
Back
Top