An organization that treats its programmers as morons will soon have programmers that are willing and able to act like morons only. Bjarne Stroustrup
An EnumSet is a Set which contains enum instance of a specific enum type, in a more efficient way than other Set implementations.
|Enumset internally uses bit vector which improve the performance.|
|It improves the time and space performance.|
|It does not throw concurrent modification exception.|
|Enumset is not synchronized.|
|All basic operations execute in constant time.||All basic operations execute in constant time.|
|Faster than Hashmap.||Faster than hash set.|
|Enum maps are represented internally as arrays.||Represented internally as bit vectors.|
|Bulk operation executes in constant time.||Bulk operation executes in constant time.|
When you don't want duplicate elements, you can use EnumSet.