So just to remind myself:
1) Private methods are not overridden / polymorphic
2) Static methods are not overridden / polymorphic
Jim ... ...
BEE MBA PMP SCJP-6
posted 6 years ago
1) Class B's printit() method is NOT overriding Class A's printit() method because of the fact that Class A's method is Private.
2) Polymorphism applies only to overriden methods and not overloaded or redefined methods.
3) Had it been the case that Class A defines printit() method to be public , then the output at second line would definitely be B, because at that time Class B overrides prinit() method and polymorphism applies to it.
SCJP 6.0 96%
(Connecting the Dots ....)
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads