<strong><br />Cheers !!<br /> <br />Sherry<br /></strong><br />[SCJP 1.4]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
If you are not laughing at yourself, then you just didn't get the joke.
Originally posted by Ilja Preuss:
Because the call to doIt in the TopClass constructor is polymorphic, that is, it will call the actual method on the object...
<strong><br />Cheers !!<br /> <br />Sherry<br /></strong><br />[SCJP 1.4]
Originally posted by Sherry Jacob:
I mean if I am making a derived class object, why is it calling the function doIt(10) in DerivedClass ?
Cud u elaborate ?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
"I'm not back." - Bill Harding, Twister
If you are not laughing at yourself, then you just didn't get the joke.
Originally posted by Arun Kumarr:
When the JVM sees the doIt() method in superclass, How does it call the Derived classes' doIt() method?? bcoz' at that point there is no Derived Class constructed at all.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
If you are not laughing at yourself, then you just didn't get the joke.
Originally posted by Arun Kumarr:
Since the JVM decides which method to call on the fly, Why is that it is confused when the methods are static?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Yup, yup, yup. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|