What is the difference between hashmap, hashtable and hashset
Hashmap:
- Hash table implements Map interface
- Hash table permits null values and the null key
- HashMap class is equivalent to Hashtable, except that it is unsynchronized and permits nulls
- It does not guarantee that the order will remain constant over time
- constant-time performance for the operations (get, put and remove)
- Time complexity - O(1) for get, put and remove
- It is not synchronized
- How to make Hashmap Synchronize
Map m = Collections.synchronizedMap(new HashMap(...));
- Exapmle:
Hashtable:
Comments
Post a Comment