Please quote that link, and read it again carefully. As you have already been told, you can't override static methods, so you may have misread the webpage.
Daniel Vlad wrote: . . . I have a link bookmarked somewhere about how overriding static methods works in Java . . .
I meant what is explained in https://coderanch.com/how-to/java/OverridingVsHiding , namely: method hiding, but i was not aware of the terminology(sorry about that) and I was associating what was happening with re-declaring the method in the subclass. Also I was posting the reply with one foot out the door, since I was in a big hurry and by the time i managed to write the reply and submit it Maneesh had already posted a proper explanation( i was still in the writing stages of the reply by the looks of the time posted).
if you do try to override you should not get a compiler error because of it
Thank you. Although that link correctly shows that static methods behave differently from instance methods, it is confusing because it still uses the word "override" and similar.
Daniel Vlad wrote:. . .
his is the link i meant: http://geekexplains.blogspot.com/2008/06/can-you-override-static-methods-in-java.html. . . .
Campbell Ritchie wrote:Thank you. Although that link correctly shows that static methods behave differently from instance methods, it is confusing because it still uses the word "override" and similar.
N Sam wrote:This brings up another question to my mind, just to clarify things. Is hiding a term, used only when static methods are in play ? It seems so, but i want to make sure.