Wednesday, June 30, 2010

Hashtable Vs Arraylist

Arraylist:
1. A Collection of Items containing a Single Item.
2. Can Add any datatype value, every item in arraylist is treated as object.
3. It will dynamically expand and contract when you add/remove elements to it.

Hashtable:
1. Collection of key,value pairs.
2. Key Can be any data-type.
3. Key Cannot be null reference, but value can be.
4. Each element is a key/value pair stored in a DictionaryEntry object.

Retrieving by key in Hashtable is faster than retrieving in Arraylist.

Sample Code Download : Hashtable_Vs_ArrayList.zip

No comments:

Image Understanding (IU)

Throughout these years, the growth of digital media collections has been accelerating, particularly in still images. These artifacts repre...