Static methods can not be overridden,...
Originally posted by Dave Vick:
Static methods can not be overridden, your code does not show that they can be because your code has no inheritance in it.
Static methods can be hidden (or shadowed) by sub classes but not overridden. The important point in this is that hidden methods (along with variables) do not take part in run time binding, the class of the method is determined at compile time based on the type of the variable. Unlike non static methods that are called based on the type of the object that the variable is refering to.
Look at this code:
run this and you should begin to see the difference.
Hope that helps you out
I'm not sure if I approve of this interruption. But this tiny ad checks out:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton