Why can't the super constructor be invoked from an enum constructor?

public enum A {
     A(1);

     private A(int i){
     }

     private A(){
         super(); // compile - error
             // Cannot invoke super constructor from enum constructor A()
     }

}

and here is the hierarchy of enum A extends from abstract java.lang.Enum extends java.lang.Object

Class c = Class.forName("/*path*/.A");
System.out.println(c.getSuperclass().getName());
System.out.println(Modifier.toString(c.getSuperclass().getModifiers()).contains("abstract"));
System.out.println(c.getSuperclass().getSuperclass().getName());
9
задан trashgod 19 March 2011 в 23:52
поделиться