Pradeep Shet
What is the difference between HashTable and ArrayList?
By Pradeep Shet in .NET on Jul 17 2014
  • Pradeep Shet
    Jul, 2014 17

    1) HashTable is a collection of objects which store values based on key where as ArrayList is just a collection of objects stored based on index 2) Retrieving value from HashTable is faster as it is linked with key whereas it is difficult in case of ArrayList value is fetched with index 3) HastTable is used for maintaining huge data

    • 1
  • Rajeev Kumar
    Mar, 2023 16

    ArrayList is an ordered Collection of objects, the objects will be in the same order that you use to add them to the ArrayList. HashTable is a Collection of Key Value Pair. Each object in the HashTable is defined by a Key and Value. Generally the ArrayList is quicker than the HashTable to insert elements in some cases

    • 0
  • Yadagiri Reddy
    Oct, 2014 17

    Following are the main differences Array List 1.Array List is a List 2.In this we can only add items to the list 3.Here we Can Add any datatype value,Every item in arraylist is treated as object Hash Table 1.Hash Table is a map 2.Here we can add data with the key 3.Retrieving by key in Hashtable is faster than retrieving in Arraylist

    • 0
  • Guest User
    Aug, 2014 1

    Array list is a list where we can add items Hash table is a map, key value pairs

    • 0
  • Rajendra Tripathy
    Jul, 2014 30

    An ArrayList is a dynamic array that grows as new items are added that go beyond the current capacity of the list. Items in ArrayList are accessed by index, much like an array.The Hashtable data structure is typically an array but instead of accessing via an index, you access via a key field which maps to a location in the hashtable by calling the key object's GetHashCode() method.In general, ArrayList and Hashtable are discouraged in .NET 2.0 and above in favor of List and Dictionary which are much better generic versions that perform better and don't have boxing costs for value types

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS