A
anup
Hi,
Can anybody point to some resource which explains how a call to the
"super" is resolved/implemented in java (or for that matter any OO
language?
I am a bit confused as to when an object of any subclass is
instantiated does an object of the super class also get created? The
answer is probably NO as only one object gets created in the memory
and the fact is documented almost in every inheritance tutorial.
But then the point is - how does "super" work, which is supposed to
act as a reference to an object of the parent class? Is there any
demarcation in the memory for the members (data/methods) of the parent
class?
Any resource on the control flow during memory allocation while
instantiating an inherited object (indicating both the function as
well as data) shall be great.
thanks and regards,
anup
Can anybody point to some resource which explains how a call to the
"super" is resolved/implemented in java (or for that matter any OO
language?
I am a bit confused as to when an object of any subclass is
instantiated does an object of the super class also get created? The
answer is probably NO as only one object gets created in the memory
and the fact is documented almost in every inheritance tutorial.
But then the point is - how does "super" work, which is supposed to
act as a reference to an object of the parent class? Is there any
demarcation in the memory for the members (data/methods) of the parent
class?
Any resource on the control flow during memory allocation while
instantiating an inherited object (indicating both the function as
well as data) shall be great.
thanks and regards,
anup