This post is just for information which i found very useful.
First go throgh the difference between Overriding and Hidding @
OverridingVsHiding.
Once this is clear.Now remember final keyword when applied to instance methods does not allow instance methods to be overriden by sub classes which we all know.
You can also apply final keyword to static methods which means static method in subclass that was earlier hiding the static method in parent class will now be disallowed by compiler.
Also note that all legal rules of overriding applies to hiding as well. Can someone confirm this statement? I tried and found it to be legal
For ex:
is legal but
causes compiler error.
Thanks
Deepak
[ November 30, 2007: Message edited by: Deepak Jain ]
[ November 30, 2007: Message edited by: Deepak Jain ]