Question 7
Back to Exercise
What is an advantage of EnumMap over HashMap for enum keys?
- A It allows null keys
- B It is array-backed, faster, more compact and iterates in declaration order Correct
- C It is thread-safe
- D It sorts by value
Correct Answer: Option B
EnumSet similarly uses a bit vector.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!