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

How to fetch a data from one table to another table in asp.net ?

0 Answers   MCN Solutions,


What are the two types of web pages?

0 Answers  


what to magage the state manament in asp.net with respect to in_prock and out_prock

1 Answers   Aviva,


How many classes can a single .NET DLL contain?

6 Answers   SoftSol,


How do u optimize a query in asp.net?

0 Answers   MCN Solutions,






Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ?

0 Answers   DELL,


Hi please tell me what is ISNOTPOSTBACK,POSTBACK,AUTOPOSTBACK and also the extensions of aspx,asmx,ascx its urgent plz reply me soon....

6 Answers   Logica CMG,


Define a web service in .net?

0 Answers  


i have one gridview contains edititemtemplate(which contains update and cancel buttons) and i have one item template (contains edit button) i want the code for update and cancelbuttons in edit item template and i want the code for edit button in itemtemplate. please help me

4 Answers  


Explain the main function of razor in asp.net? : asp.net mvc

0 Answers  


What is a server farm in iis?

0 Answers  


You are using the try? catch block seen in the following code segment, but no exceptions are ever caught by the catch block. What is the problem? SqlConnection cn =new sqlConnection(strSQL); SqlDataSet ds; try { cn.open(); //perform the data processing steps ??.. } catch (OleDbException e) { ?.. } a) The exception class is wrong; it should be sqlErrors. b) The exception class is wrong; it should be sqlSyntaxExceptios. c) The exception class is wrong; it should be sqlExceptions. d) The exception class is wrong; it should be sqlExcptions.

2 Answers   Microsoft, Syntax Softtech,


Categories