Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4401321

Add type-safe enums to Java

XMLWordPrintable

    • tiger
    • generic, x86
    • generic, windows_95, windows_nt


      Enumeration types similar to the c++ "enum" are not available in Java. I
      searched the bug reports and could not find a match, this may be from a
      dilution of other issues related to the terms Enumeration, Enumerated. Along
      with the issues and workarounds outlined in

      http://www.firstsql.com/java/gotchas/lfside3.htm

      there is no way to use a type checked enumeration in the java "switch" statement with any of the cumbersome
      workarounds. I find I use a lot of enumerations with my coding style, it seems
      this would also be useful for others programming in Java. I could go on here
      but the point I am trying to make is simple.
      (Review ID: 115234)
      ======================================================================

            gafter Neal Gafter (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: