crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Hashtable vs Dictionary in csharp?
Question Posted on 26 Apr 2022Home >> DotNet >> C# >> Hashtable vs Dictionary in csharp?

Hashtable vs Dictionary in csharp?
Below are the some of the common difference between Hashtable and Dictionary:-
0
0

Base of DifferenceDictionaryHashtable
TypeDictionary is basically a generic type Dictionary <TKey,TValue>Hashtable is basically a non-generic type.
Boxing and UnboxingIn Dictionary we donot have need of boxing and unboxing.Values in hashtable need both boxing and unboxing.
Weak StrongDictionary class is strong type so you must specify the data types for key and value (<TKey,TValue>).Hashtable is basically a weak type data structure so we can add keys and values of any of object type.
Non-Existing keyIn Dictionary when we try to access non existing key dictionary we will get runtime error.But when we try to access non existing key hashtable it will produce null values.
Order of ValuesDictionary maintains an order of stored values.On the other hand Hashtable never maintains an order of stored values.
SpeedAs there is no need of boxing and unboxing it is faster than hashtable. Hashtable needs boxing and unboxing so it is slower tahn Dictionary.


.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

Simplest definition of partial classes and its rules?

Definition of Tuple class with some examples?

Define Race Condition in cSharp?

C#.Net Reserve Words

can we inherit private class level variables in c#






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap