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

What are the different modes for the sessionstates in the web.config file?

2 Answers  


Explain the steps needed to be performed in order to create an animation in xaml?

0 Answers  


what are partial classes and their use?

3 Answers   Microsoft,


What types of data validation events are commonly seen in the client-side form validation?

0 Answers  


How can you ensure a permanent cookie?

0 Answers  






How ASP.NET page works?

0 Answers   MCN Solutions,


What base class do all Web Forms inherit from?

8 Answers  


How to execute a stored procedure.and how to call it form a asp page

2 Answers  


What are the objects in used in ASP for processing input and outputs?

1 Answers  


what are the differences between windows services and web services?

5 Answers   Tech Mahindra,


Do I need to have the latest version of windows media player installed?

0 Answers  


what is the differance between .DLL & .EXE

10 Answers   Infinite Computer Solutions,


Categories