Static methods are inherited but cannot be overriden they can be re- defined. Its Compiler error if you try to override a static method with non static method or override non static method with static method.
Even final method is also inherited. But in K & B book it's written "only inherited methods can be override". But as we just saw you can inherit final & static methods but you cannot override them. Anyone explain?
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.