Home > Software > .NET > ASP.NET
Interview Questions   Tutorials   Discussions   

ASP.NET - What is the main difference between hash table and Dictionary?




294
views
asked mar October 4, 2014 11:44 AM  

What is the main difference between hash table and Dictionary?


           

1 Answers



 
answered By siddhant   0  

HashTable Class

Hashtable in C# represents a collection of key/value pairs which maps keys to value. Any non-null object can be used as a key but a value can. We can retrieve items from hashTable to provide the key . Both keys and values are Objects.

Dictionary

A Dictionary class is a data structure that represents a collection of keys and values pair of data. The key is identical in a key-value pair and it can have at most one value in the dictionary, but a value can be associated with many different keys.

This class is defined in the System.Collections.Generic namespace, so you should import or using System.Collections.Generic namespace.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert