Q
qazmlp1209
I have an enum like this:
public enum GRADE {
ONE, TWO, THREE
}
I need to do the mapping from the corresponding string values to one of
these enum values. If the String value is "ONE", then the enum value
ONE should be assigned.
For example:
enum GRADE = someThing ("ONE") ;
Now, the GRADE should be assigned ONE.
What should someThing be replaced with here, for the above to
work(without changing the definition of GRADE)?
public enum GRADE {
ONE, TWO, THREE
}
I need to do the mapping from the corresponding string values to one of
these enum values. If the String value is "ONE", then the enum value
ONE should be assigned.
For example:
enum GRADE = someThing ("ONE") ;
Now, the GRADE should be assigned ONE.
What should someThing be replaced with here, for the above to
work(without changing the definition of GRADE)?