... programming requires more concentration than other activities. It's the reason programmers get upset about quick interruptions' - such interruptions are tantamount to asking a juggler to keep three balls in the air and hold your groceries at the same time. Steve McConnell
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.