HashSet is a class in java that implements a set interface & extends abstractSet. It allows you to store only unique elements which means no duplicates are allowed. It is a member of the Java Collection Framework.