To clarify further:
The code
produces a compile-time error, because the code tries to override a static method. This behavior is defined by section 8.4.6.1 of the
Java Language Specification.
The code
will compile successfully.
Neither of the code fragments successfully
overrides anything. The last code fragment illustrates
Hiding by Class Methods as described by section 8.4.6.2 of the Java Language Specification.
Overriding and
hiding are closely related, since they both prevent the method from the super class from being inherited to the subclass, but technically it is incorrect to mix these terms.