enum vs static final String
807605Jun 12 2007 — edited Jun 12 2007I was going to use static final Strings as enumerated constants in my application, but would like to see if I should be using enums instead.
In terms of efficiency, if I have, say, 5 enumerated elements, will only one copy of the enumerated element be in memory, like a static final String? So regardless of how many times I refer to it, all references point to the same instance (I'm not sure if what I just said even makes sense in the context of enums, but perhaps you could clarify).
Are there any reasons why for enumerated constants that are known at development time, why static final Strings (or static final anything, for that matter) should be used instead of enums if you're using JDK 1.5?
Thanks.