Check out example codes for "enum with numbers java". It will help you in understanding the concepts better.

Code Example 1

public enum EXIT_CODE {
    A(104), B(203);

    private int numVal;

    EXIT_CODE(int numVal) {
        this.numVal = numVal;
    }

    public int getNumVal() {
        return numVal;
    }
}

Learn ReactJs, React Native from akashmittal.com