Hi Guest

HomePage

1 1

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

Hashtable vs Dictionary in csharp?
Question Posted on 26 Apr 2022

Home >> 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#






Most Visited Questions
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |
     
 
Privacy policy | Terms and Conditions | Blog


If the copyright of any questions or content or syntax belong to you email us we will remove that(info@crackyourinterview.com or crackyourinterview2018@gmail.com)
 

1
Home About Us GroupChat
 
Sitemap Feedback Contact us