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,
The easiest way:
Category[] category = Category.values(); for (int i = 0; i < cat.length; i++) { System.out.println(i + " - " + category[i]); }
Where Category is Enum name
Enum