Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Differences Between Hashtable and Dictionary
WhatsApp
Atul Kumar
12y
155.5
k
0
4
25
Blog
Differences Between Hashtable and Dictionary
1. Hashtable is threadsafe and while Dictionary is not.
2. Dictionary is types means that the values need not to boxing while Hashtable
values need to be boxed or unboxed because it stored the values and keys as
objects.
3. When you try to get the value of key which does not exists in the collection, the
dictionary throws an exception of 'KeyNotFoundException' while hashtable returns
null value.
4. When using large collection of key value pairs hashtable would be considered more
efficient than dictionary.
5. When we retrieve the record in collection the hashtable does not maintain the order
of entries while dictionary maintains the
order of entries by which entries were added.
6. Dictionary relies on chaining whereas Hashtable relies on rehashing.
Differences Between Hashtable and Dictionary
People also reading
Membership not found