So, I am working on this class that has a few static constants:
public abstract class Foo {
...
public static final int BAR;
public static final
If you're using it in a switch case then you need to get the type of the enum even before you plug that value in the switch. For instance :
SomeEnum someEnum = SomeEnum.values()[1];
switch (someEnum) {
case GRAPES:
case BANANA: ...
And the enum is like:
public enum SomeEnum {
GRAPES("Grapes", 0),
BANANA("Banana", 1),
private String typeName;
private int typeId;
SomeEnum(String typeName, int typeId){
this.typeName = typeName;
this.typeId = typeId;
}
}