June 3, 2009 at 10:59 AM
Java Enumerated types specifies what values can be assigned to a variable.This makes the Java code more readable.Enumerations are type safe means that if you define a method then the caller cannot pass in a value that does not correspond to an enumeration value. An Enumeration object generates a series of elements, one at a time which is used for passing through a collection.
It provides Compile-time type safety.For each enum type,a namespace has been provided by Type system.Therefore you don't have to prefix each constant name.Typesafe constants(Enum) aren't compiled into clients, so you can add, reorder or even remove constants without the need to recompile clients. You can add arbitrary fields and methods to an enum class.An enum type implements the arbitrary interfaces.