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 is Bundling and Minification in MVC?

0 Answers   HCL,


how to integrate Language conversion, without asking the enduser to download font, it should auto integrate

1 Answers  


How does the cookies work in asp.net?

0 Answers  


What is asp.net used for?

0 Answers  


What does the following SQL statement return, assuming that all tables and column names are correct? SELECT FirstName, StreetAddress FROM Employees JOIN AddressBook ON Employees.EmpID = AddressBook.EmpID a) Nothing, the JOIN syntax is wrong. b) All the records form the Employees table, and only the matching ones form the StreetAddress table. c) All the records from the StreetAddress table and only the matching records form the Employees table. d) Only the matching records from the two tables.

4 Answers   Syntax Softtech,






what is PostBack Property exactly ? when It Returns True? when it Returns False?

1 Answers  


What is form submit?

0 Answers  


How to create discussion forum in asp.net mvc? : Asp.Net MVC

0 Answers  


Explain About WebService

0 Answers   BirlaSoft,


The technical part was on ASP.Net only of web services.

1 Answers   Symphony,


Describe the diffeerence between inline and code behind?

0 Answers  


Is it right that ASP.NET Web API has replaced WCF?

0 Answers  


Categories