The HashSet and TreeSet, both classes, implement Set interface. The differences between the both are listed below.