When you say enums are constant in java, what do you actually mean?
What type of constant(integer constant , char constant, string constant) are they?
Why Java system is not complaining when I use enums as switch cases value?
As for as i know prior to 1.7 switch statement accepts byte, short, int or char as case value. So when someone say enum are constant and they can be used in switch cases, what type of constant they mean because switch accepts only byte, short, int or char
For example String constants, they are added in java 1.7 but enum are there since 1.5 and they are being used in switch cases value and now from Java 1.7 on words I can use String as switch case value?
How does Java handles enum in switch cases, does it use ordinal() value of enums?