Two very different collection classes.
An ArrayList behaves just like an array, except that it will dynamically expand and contract when you add/remove elements to it.
A HashTable is useful when you want to lookup objects indexed by a 'key' value. It also dynamically expands and contracts but doesn't impose an order on the elements like an array does. Put a different way: you index elements in an ArrayList with a numeric index, you index elements in a HashTable with a key.
ArrayList
1.Array List is a List.
2.In Array list we can only add items to the list.
3.Here we Can Add any datatype value,Every item in Arraylist is treated as object.
4.Index Numeric.
5.Data in Arraylist is stored in as only the value.
6.Slow when come to search
Hash Table
1.Hash Table is a map.
2.In Hashtable we can add data with the key.
3.Retrieving by key in Hashtable is faster than retrieving in Arraylist.
4.Index can be string also.
5.Data in Hashtable is stored in the key-value pair.
6.Fast when searching.
1.Hash Table is a map.
2.In Hashtable we can add data with the key.
3.Retrieving by key in Hashtable is faster than retrieving in Arraylist.
4.Index can be string also.
5.Data in Hashtable is stored in the key-value pair.
6.Fast when searching.