You can access static members of a given class by its reference, this is kinda bizarre but the compiler just check the reference's type of the variable and switch it for you on the bytecode, for example:
What the compiler do is to check what type "a" is and then switch it for you. All the lower a's becomes upper A's in the bytecode. But be carefull, the compiler does it based on the reference type, not the objec. For instance:
Even your object is of B type, you are accessing the A members!
[]
And then the flying monkeys attacked. My only defense was this tiny ad:
Gift giving made easy with the permaculture playing cards