public class Test {
public enum Directions {
NORTH, WEST, SOUTH, EAST
}
static final Directions D1 = Directions.NORTH;
static class Inner {
static final Directions D2 = Directions.NORTH;
}
class Inner2 {
static final Directions D3 = Directions.NORTH;
}
}
I am getting the IDE-Error which is in the title, referring to the variable D3. Can someone explain that to me? Why can I not declare a static variable in an inner class that is not static and why is the enum value not a constant?