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

Compiler should prohibit extending java.lang.Enum

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 5.0
    • 1.4.0, 5.0
    • tools
    • b46
    • generic, x86
    • generic, linux

      The JSR-201 Public Review Draft Spec says that it is illegal for a class to extend java.lang.Enum explicitly but compiler permits it. The following program should generate an compile-time error. In fact it crashes the compiler:

      public class Junk extends Enum {
          Junk() { super(null, 0); }
      }

            darcy Joe Darcy
            jjb Josh Bloch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: