enum constant as key in hashtable

Hi,

when i create a class i must override the equals and hashCode methods, in order to be able to place objects of this class in a hashtable.

What do i need to do for placing enum constants as keys in a hashtable? equals is declared final, so i cannot override it. Do i need to override the hashCode only?

Thanks

[337 byte] By [uiga] at [2007-11-27 5:43:18]
# 1
It's good to go -- you don't need to do anything. and consider using [url= http://java.sun.com/javase/6/docs/api/java/util/EnumMap.html]EnumMap[/url]
Hippolytea at 2007-7-12 15:22:45 > top of Java-index,Java Essentials,Java Programming...