|
Java Enum was introduced in JDK 1.5 and it is one of my favorite features on J2SE 5. Java Enum as type is more suitable on certain cases for example representing state of Order as NEW, PARTIAL FILL, FILL or CLOSED. Enum was not originally available in Java though it was available in other language like C and C++ but eventually Java realized and introduced Enum on JDK 5 (Tiger). In this Java enum tutorial we will see different examples of java enum and how to use Enum in Java. Focus of this java enum tutorial will be on different features provided by Enum in Java and how to use them. If you have used Enum before in C or C++ than you will not be uncomfortable with Java enum but in my opinion Enum in Java is more rich and versatile than in other language. |
 |