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. Other websites on Java Tiger can be found at Links-for-Java.

Home


Copyright 2006-2007 Open Merchant Account Ltd..
SMS to a friend