|
Helping ordinary people create extraordinary websites! |
Getting Started with Enumerated TypesBy Brett McLaughlin2005-04-22
Going Further Enums can also be used in conjunction with sets, and much like the new EnumMap construct, Tiger supplies a new Set implementation EnumSet that allows you to work with bitwise operators. Additionally, you can add methods to your enums, use them to implement interfaces, and define what are called value-specific class bodies, where specific code is attached to a particular value of an enum. These features are beyond the scope of this article, but they're well documented elsewhere (see Resources). Tutorial Pages: » Represent Constants in a Typesafe Manner Using Java 5.0 » Defining an Enum » Working with Enumerated Values » Enums and Collections » Going Further » Use Them, But Don't Abuse Them » Resources First published by IBM developerWorks |
|