Is anything like this possible in Java? Can one assign custom numeric values to enum elements in Java?
public enum EXIT_CODE {
A=104, B=203;
}
public enum EXIT_CODE {
A(104), B(203);
private int numVal;
EXIT_CODE(int numVal) {
this.numVal = numVal;
}
public int getNumVal() {
return numVal;
}
}