posted 19 years ago
If i am not wrong,The method which is overridden is not said to be inherited. Please check the code, here static init() is hidden
As we know static methods are resolved during compile time and a static method call is done according to type of reference, Here type of override is OverrideStatic, so on calling override.init(). the hidden static init() method of OverrideStatic class is called.This is clear to me.
Now when we call override.local();, the call is resolved by dynamic binding and the local() of class A is called, which will futher contain call to init() and hi(), Now i know that hi() of Override class is called, but why init() of Override is not called, as Type of original override reference is OverrideStatic and init() is also hidden in class Overriden.
In summary i need clerification on call of init() in side local() method of class A. Which init() will be call and Why ???
( tags added so that mere mortals can read it)
[ June 16, 2005: Message edited by: Barry Gaunt ]