这应该是完全显而易见的,但事实并非如此。有没有办法获得枚举的值,如下例所示?
例子:
public enum Numbers
{
zero, one, two
}
//later on
Numbers numbers = Numbers.zero;
// this is the part that I can not figure out the java equivalent of?
int number = numbers.value();
这对我想要做的事情有意义吗?