What\'s the easiest and/or shortest way possible to get the names of enum elements as an array of Strings?
String
What I mean by this is that if, for example,
i'd do it this way (but i'd probably make names an unmodifiable set instead of an array):
import java.util.Arrays; enum State { NEW,RUNNABLE,BLOCKED,WAITING,TIMED_WAITING,TERMINATED; public static final String[] names=new String[values().length]; static { State[] values=values(); for(int i=0;i