posted 14 years ago
if you wrote this:
What would happen when you then called
The object that is actually created has NO IDEA what methodB() is - it doesn't exist. But the reference says that you can call it.
It would be like saying you have a "class Animal" and a ''class fish extends animal". You can refer to any fish as an animal, but you can't refer to any animal as a fish.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors