Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Use cases of Java enumeration

JDK 1.5 introduces a new type -- enumeration. In Java, it's just a small feature, but it can bring us much convenience.Here we summarize some use cases of Java enumeration.1. ConstantPrior to JDK 1.5, we can define constant as public static final..., now we can use enumeration to group all constants in one enum variable and it also provides some useful functions.public enum Color {    RED, GREEN, BLANK, YELLOW  }  2.In SwitchPrior to JDK 1.6, only int,char and enum are supported in switch statement, with enum, we can write more r...

3,538 0       JAVA ENUMERATION ENUM