Originally posted by Bala Rajamani:
[B]HI All,
Can some one explain why its calling super class add(int a) method?
[/B]
Originally posted by Prashanth Joisha:
Hi,
This is a good question - stumped me.
However, I still fail to understand the explanation
given - I thought that when a method is invoked its
the class of the object denoted by the reference
and not the reference itself comes into play. So
that said I would think the add(char c) in test2
class could have been executed.
Regards,
PJ
really been executed
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
SCJP2. Please Indent your code using UBB Code
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|