You are allowed to have fields / enumeration methods specific to each element like this in java
enum E {
A {
public int a = 3;
},
B {
public void x() {}
};
}
But you are not allowed to do this:
int x = E.A.a;
E.B.x()
Why is this not allowed?
source
share