Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
I'm trying to understand polymorphism and I'm confused about what it means when a reference of a class holds a reference to one of its subclasses. For example:
Car Mustang = new Ford();Is Mustang a Car or a Ford, or both???? And why would it be necessary for a Mustang to be a Car when the Ford object would have more details and specific methods in it. It seems as though Ford would be more useful so why reference from a Car object?
Thanks,
Von