February 2014
Beginner
1248 pages
62h 25m
English
• An enum type (p. 221) is introduced by the keyword enum and a type name. As with any class, braces ({ and }) delimit the body of an enum declaration. Inside the braces is a comma-separated list of enum constants, each representing a unique value. The identifiers in an enum must be unique. Variables of an enum type can be assigned only constants of that enum type.
• Constants can also be declared as private static final variables. Such constants are declared by convention with all capital letters to make them stand out in the program.
Read now
Unlock full access