Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Why is Dictionary preferred by the developers over hashtable in C#?

Damian99Damian99 USAPosts: 116Member

Can someone please explain me why is Dictionary preferred over hashtable in C#?



  • mk44mk44 UKPosts: 9Member

    Dictionary is type safe, Hashtable isn't.

  • DavidMDavidM USAPosts: 342Member

    Dictionary is a generic type, Hashtable is not. Type safety is assured with Dictionary since it is not possible to insert any random object into it. It is not required to cast the values you take out.

Sign In or Register to comment.