is there a preformance hit when using enum.values() vs. String arrays?
- by Asaf
i'm using enums to replace String constants in my java app (jre 1.5).
is there a performance hit when i treat the enum as a static array of names, in a method that is called constatnly (e.g. when rendering the UI)?
my code looks a bit like this:
public String getValue(int col) {
return ColumnValues.values()[col].toString();
}
thanks, asaf :-)