T
Tony Morris
// Usually you list enum constants in alphabetical order.
A potential gotcha here is that changing the order of appearance of enum
fields may break existing clients.
http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html
"Note that each enum type has a static values method that returns an array
containing all of the values of the enum type in the order they are
declared."
Reflection APIs make no such guarantee of order, and so this does not apply
to other type fields.
--
Tony Morris
http://tmorris.net/
Java Questions and Answers
http://jqa.tmorris.net/
// Eclipse will put them in alphabetical order when you do
// a Source Sort Members.
A potential gotcha here is that changing the order of appearance of enum
fields may break existing clients.
http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html
"Note that each enum type has a static values method that returns an array
containing all of the values of the enum type in the order they are
declared."
Reflection APIs make no such guarantee of order, and so this does not apply
to other type fields.
--
Tony Morris
http://tmorris.net/
Java Questions and Answers
http://jqa.tmorris.net/