Which instance method will be called depends on the actual class of the object and not the class of the variable referencing it. Here, the actual object is of class C.
But this happens only when the method is inherited accross the hierarchy. Here, in class B, f() is private and so is not inherited by class C. So, when method g() of class B calls f(), class B's f() is called instead of class C's.
HTH,
Paul.
------------------
Get Certified, Guaranteed!
(Now Revised for the new
Pattern)
www.enthuware.com/jqplus