Learn more about this topic
- Complete code and examples for this tip
http://images.techhive.com/downloads/idge/imported/article/jvw/2002/01/javatip122.zip - Read one of the earliest cases for the typesafe enum construct in this Java Developer Connection (JDC) Tech Tip, "Using Enumerations in Java Programming," Glen McCluskey (August 2001)
http://developer.java.sun.com/developer/JDCTechTips/2001/tt0807.html - James Gosling and Henry McGilton originally advised Java programmers on how to cope with Java's enum absence in "The Java Language Environment" whitepaper (see the "2.2.3 No Enums" section)
http://java.sun.com/docs/white/langenv/Simple.doc2.html - For more details on typesafe enum implementation complexities, see the "Substitutes for Missing C Constructs" chapter of Joshua Bloch's Effective Java Programming Language Guide (Addison Wesley Professional, June 2001; ISBN0201310058); specifically the "Replace Enum Constructs with Classes" section
http://developer.java.sun.com/developer/Books/shiftintojava/page1.html - For more on the difference between the == operator and using the equals() method, see this JGuru FAQ entry
http://www.jguru.com/faq/view.jsp?EID=13549 - For more articles on the JDK, visit JavaWorld's Topical Index
http://www.javaworld.com/channel_content/jw-jdk-index.shtml - View all previous Java Tips and submit your own
http://www.javaworld.com/javatips/jw-javatips.index.html - Learn Java from the ground up in JavaWorld's Java 101 column
http://www.javaworld.com/javaworld/topicalindex/jw-ti-java101.html - Java experts answer your toughest Java questions in JavaWorld's Java Q&A column
http://www.javaworld.com/javaworld/javaqa/javaqa-index.html - Sign up for JavaWorld's free weekly email newsletters
http://www.javaworld.com/subscribe - Speak out in JavaWorld's Java Forum
http://forums.idg.net/webx?13@@.ee6b802 - You'll find a wealth of IT-related articles from our sister publications at IDG.net
This story, "Java Tip 122: Beware of Java typesafe enumerations" was originally published by JavaWorld.