Enumerated types with Java Tiger (J2SE 5.0)

Java 1.5 now supports enumerated types, which equate roughly to static final constants.

To use them, they can be declared thus:

  public enum StopLight { red, amber, green };
 

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd