Howdy!
static methods aren't overridden, but
redefined.
It is not called an override because they do not behave polymorphically as non-static methods do.
As I said, this is not called an override. If the method was non-static, the last line would produce a "B" because of
polymorphism. For static method, only the variable type counts.
Therefore it is recommended not to call static methods on variables.
By the way, despite the fact that this is NO override, some behaviours are the same when comparing overriding and redefinition. For example you cannot make the static method in the child less visible than in the parent and you cannot throw broader exceptions.
final:
as in a non-static method where final does not allow overriding, in a static method final does not allow redefinition. When you make the method final in class A, class B will no longer compile.
Yours,
Bu.