K
kathukutti
Hi all!!!!!!!
consider the following inheritance hierarchy
Class A --> Class B --> Class C
As per rule: Object of A can be referenced by their subclass objects.
Eg: consider a,b,c are objects of classes A,B,C . Here a=b &a=c is
applicable but 'object a' can access only its own member nor the
members of 'B & C'
question: But consider All the classes (A,B,C) override a single
method namely disp(). Now
case 1: a=b; a.disp();==> calls the Class B's disp() method though it
is not a member of A.
IIIy for a=c; a.disp()
Thanx in advance!
consider the following inheritance hierarchy
Class A --> Class B --> Class C
As per rule: Object of A can be referenced by their subclass objects.
Eg: consider a,b,c are objects of classes A,B,C . Here a=b &a=c is
applicable but 'object a' can access only its own member nor the
members of 'B & C'
question: But consider All the classes (A,B,C) override a single
method namely disp(). Now
case 1: a=b; a.disp();==> calls the Class B's disp() method though it
is not a member of A.
IIIy for a=c; a.disp()
Thanx in advance!