I stumbled over the following problem that i can't extend and implement from this class which is defined in Java 1.5 (java.lang package)
public abstract class Enum<E extends Enum<E>> {...
}..
The problem i have is to create my own enum type which has different ordinal values. I don't want to implement it by using different name of ordinal like getCode() etc. So i thought i could go the way to extend the above class.
public final class XYZ extends Enum<XYZ> { //Does not work.
//
A("A", 1),
B("B", 7);
.
}
I know that i can do the following:
public enum NEWEnum {
A(1),
B(7);
private int code;
private NEWEnum(int code) {
this.code = code;
}
public int getCode() {
return this.code;
}
}
I would prefer to have the usual namings in Enum's like ordinal() and name() instead.