AA is a static variable. This is a bad idea, but authorized to access a static class variable using a variable that refers to an instance of this class, even if it is null. This is not limited to enumerations:
Integer i = null;
System.out.println(i.MAX_VALUE);
works fine. But it really should be written as
System.out.println(Integer.MAX_VALUE);
source
share