What is the main difference between hash table and Dictionary?

Answers were Sorted based on User's Feedback



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

Answer / lakshmi maddala

Dictionary and Hash table are collection of data structure to hold data as key/value pairs.
Dictionary is generic type, hash table is not
We can't use dictionary with web services.
In .NET hash table is thread safe for use by multiple reader thread and a single writing thread, while in dictionary public static members are thread safe, but any instance members are not guaranteed to be thread safe.

Is This Answer Correct ?    15 Yes 2 No

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

Answer / mehdi

Dictionary is a generic type, Hashtable is not. That means
you get type safety with Dictionary, because you can't
insert any random object into it, and you don't have to
cast the values you take out.

Is This Answer Correct ?    15 Yes 3 No

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

Answer / sunil kumar

Dictionary is a generic type, Hashtable is not. Now what that
means.You get type safety with Dictionary, because you can't
insert any random object into it, and you don't have to cast
the values you take out.
And also generic collections are a lot faster as there's no
boxing/unboxing
Again Hashtable also have to box/unbox, which may have memory
consumption as well as performance penalties.

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

In which form does the dataset store data in it?

3 Answers   Verinon Technology Solutions,


Why is this service branded with windows livetm?

0 Answers  


how can i deploy a asp.net webapplication.in a company so that all employees may access application on their different computers and share a single database. plz tell me the steps to do it..thanks.

1 Answers  


Advantage of data Reader?

2 Answers  


what is webpart? what r the parts in this webpart (zone)

2 Answers  






How can you handle exceptions in asp.net?

0 Answers  


Explain what are the advantages of asp.net mvc framework? : asp.net mvc

0 Answers  


Why is string called immutable data type?

0 Answers  


What is preprocessor in .net?

0 Answers  


Explain the purpose of storyboard.targetproperty.

0 Answers  


Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?

0 Answers  


Where would you use an iHTTPModule, and what are the limitations of any approach you might take in implementing one?

1 Answers  


Categories