Or add an interface outside of your enum
but inside of the same compilation unit (= same file) as follows:
package test;
interface Constants {
String DESC = "A String";
}
public enum Enumtricks {
Enumtricks(Constants.DESC);
private final String description;
private Enumtricks(final String description) {
this.description = description;
}
public String value() {
return this.description;
}
}
That way, you can group all your constants in front of your enum
.