posted 22 years ago
I have trouble understanding why this is so...
This would print:
Method in Class B invoked
Class A
Why is this? whenever I use obj.varName, does it look in the declared type, not the actual object? As opposed to methods, which look to the actual object?
Thanks for your help,
Craig
------------------
boolean isDevilish(Human h)
{
if(h==CraigFlannagan)
return true;
else return false;
}
[This message has been edited by Craig Flannagan (edited October 21, 2001).]
<blockquote><font size="1" face="Verdana, Arial">code:</font><hr><pre><font size="2"><br />boolean isDevilish(Human h)<br />{<br /> return (h==CraigFlannagan);<br />}<br /></font></pre><hr></blockquote>