Introduction of HashMap:
HashMap is an implementation of Map interface. It is dynamically resizable data structure. It contains only data in key-value pair where key has to be unique. HashMap can increase or decrease its size dynamically.
HashMap is not synchronized. If more than one thread try to access elements in map simulataneously and one of the thread modifies the element, JVM throws concurrentmodification exception. Hence, HashMap should be synchronized in a multi threaded enviornment. HashMap does not maintain the order in which elements were inserted to the collection.
Get operation in HashMapis completed in Constant Time. Hence HashMap has O(1) complexity for Get operation.
HashMap class in JAVA provides following methods:
1. put(Object key, Object value)
2. get(Object key)
5. containsKey(Object key)
6. containsValue(Object value)
More about HashMap including time complexity is coming very soon.