Getting Started with Adobe After Effects - Part 6: Motion Blur
This module helps you to share, discuss and learn interview questions and answers of different technologies

What is difference between dictionary and hashtable?

Jan 21 2012 8:16AM by Ramireddy   

Question

Both dictionary and hashtable can be used to stored key/value pairs. But what is the difference between them? When one will be used over other?

Answer

Dictionary provides generic types <T Key, T Value> , which allows to create dictionary of any type. Where as HashTable will store values in the form of object. So, while using a collection of primitive types such as integer, hashtable will have additional cost of boxing and unboxing, where as dictionary is generic, it will not have additional cost of boxing and unboxing.

If the collection if of type int,datetime,float etc, Dictionary provides better performance than hashtable.

If the collection is of type custom object, Both will provide same performance.

Read More..   [32134 clicks]

Published under: ASP.NET Interview questions ·  ·  ·  · 


Ramireddy
3 · 40% · 12972
0
Liked
 
0
Asked



Submit

2  Comments  

  • This comment is waiting for moderation.

    commented on Feb 5 2015 2:17AM
    richardalgor
    1407 · 0% · 16
  • This comment is waiting for moderation.

    commented on Mar 11 2015 4:56AM
    ferrero
    1407 · 0% · 16

Your Comment


Sign Up or Login to post a comment.

"What is difference between dictionary and hashtable?" rated 5 out of 5 by 5 readers
What is difference between dictionary and hashtable? , 5.0 out of 5 based on 5 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]