posted 15 years ago
Hi,
I guess this is the concept. Static methods are loaded during the compilation itself. So the methods already exists. Both the parent and the child static method exists in the run time environment in this case and the runtime system, uses the method of the child. Thus the parent static method is hidden.
Instance methods cannot be used to hide static methods because, instance method overriding is done during runtime, i.e. dynamic lookup. The required method of the Parent or the child is loaded at runtime dynamically. As this is not possible with static methods, instance methods cannot hide static methods.
I guess this is the difference between the hiding and overriding concepts.
Others please let me know if my thought process is correct.
Thanks,
Priya.