<<< Enumeration | Index | Enumeration example >>> |
The syntax for declaring an enumeration
public enum EnumerationName { CONSTANT_NAME1[, CONSTANT_NAME2]... }
An enumeration that defines three shipping types
public enum ShippingType { UPS_NEXT_DAY, UPS_SECOND_DAY, UPS_GROUND }
A statement that uses the enumeration and one of its constants:
ShippingType secondDay = ShippingType.UPS_SECOND_DAY;
<<< Enumeration | Index | Enumeration example >>> |