Introduction of HashSet:
HashSet is an implementation of Set interface. It is dynamically resizable data structure. It contains only unique set of elements. HashSet can increase or decrease its size dynamically.
HashSet is not synchronized. If more than one thread try to access elements in Set simulataneously and one of the thread modifies the element, JVM throws concurrentmodification exception. Hence, HashSet should be synchronized in a multi threaded enviornment. HashSet does not maintain the order in which elements were inserted to the collection.
HashSet class in JAVA provides following methods:
1. add(Object element)
2. contains(Object element)
3. remove(int index)
More about HashSet including time complexity is coming very soon.