well this one protecte question is takng me on the knuckles...
I really appreciate what sherrif here has tried to teach...but I wonder why ur concept is conflicting with what we usually learned...
Sherrif I only want to share & learn from ur experience, so if I am pouring something black out here pls. obliedge me!!
Folks we have a straight hierarchy of three classes with top one lets say as Grand Father...middle one as father ..and the last one as child.
Grand father is living in one house and the father and the child bth are living in one.
1. Now if something that is being inherited by father is also inherited by the child by default....
2. As per the last response the sherrif poured in, I believe there is no
polymorphism going on in here,
the object of class C(Father) is trying to call its inherited sh() and object of class B(Child) is trying to call its own, unfortunately both have no definition neither declaration, of sh() so at both the events of
c.sh();
b.sh();
the sh() will propgte upwards through the hieraarchy finding the method sh()...which both objects will find in he grand pa class.
I had tried to run the code here, but i got the same error, either books are wrong, or what the junk is goin around in here!!
Clear It Up Sherrif...In simple words..I will be more than thankful!!
Arios
A learner