enum in Java

Enumerations represent a group of named constants.
* Enum is internally implemented by using Class. 
    * All enums implicitly extend java.lang.Enum class. As a class can only extend one parent in Java, so an enum cannot extend anything else; but an enum can implement interfaces.
    * An enum can have member variables and methods. 
    * An enum can contain a constructor and it is executed separately for each enum constant at the time of enum class loading. We can’t create enum objects explicitly and hence we can’t invoke enum constructor directly.
* Every enum constant represents an object of type enum. 
    * Every enum constant is always implicitly public static final. Since it is static, we can access it by using the enum name. Since it is final, we can’t create child enums.
    * It is a compile-time error to refer to a static field of an enum type from a constructor, instance initializer, or instance variable initializer of the enum type, unless the field is a constant variable. All enum constants are implicitly public, static and final. This means that they'll be initialized before static non-final fields of the class. So the field will not be initialized when you try to access it from the constructor.
* Enum type can be passed as an argument to switch statements. 
* We Cannot compare an int and enum value directly.
```
class Class {
        enum Value {
                One(1), Two(2), Three(3);
                private int value;
                Value(int value) {
                        this.value = value;
                }
                public int getValue() {
                        return value;
                }
        };
        public static void main(String[] args) {
                Value value = Value.One;
                System.out.println(value);
                System.out.println(value.getValue());
        }
}
```