New course! Every coder should learn Generative AI!
Try a free lesson0
enums are essentially just a list of constants. Enums can have integer values assigned to them (or any type for that matter)
enum e {
ONE(1), TWO(2), THREE(3);
int value;
e(int i) {
value = i;}
int getValue() {
return value;}
}