An enum specifies a list of constant values assigned to a type.
An enum is NOT a String or an int.
An enum constant's type is the enum type.
An enum can be declared outside or inside a class, but NOT in a method.
You can NEVER invoke an enum constructor directly.
The enum constructor is invoked automatically, with the arguments you define after the constant value.
You can define more than one argument to the constructor, and you can overload the enum constructors
An enum declared outside a class must NOT be marked static, final, abstract, protected, or private.
enum constants can send arguments to the enum constructor, using the syntax BIG(8).
Compiling an enum generates a .class file whose name is derived from the enum's name.
The semicolon at the end of an enum declaration is optional. These are legal:
enum Foo { ONE, TWO, THREE}
enum Foo { ONE, TWO, THREE};
Foo.values() returns an array of MyEnum's values.
|