Computer Science Canada Help in deriving a class |
Author: | Junaid2pac [ Mon Jun 25, 2007 6:22 pm ] |
Post subject: | Help in deriving a class |
Can someone explain how to derive a class and explain the use for it??? Thank |
Author: | wtd [ Tue Jun 26, 2007 11:19 am ] |
Post subject: | RE:Help in deriving a class |
The question you should be asking is "what is polymorphism, and why should I care?" |
Author: | Junaid2pac [ Tue Jun 26, 2007 12:40 pm ] |
Post subject: | Re: Help in deriving a class |
That was actually my next question So ya...Any guidance will be helpful |
Author: | Junaid2pac [ Tue Jun 26, 2007 1:01 pm ] |
Post subject: | Re: Help in deriving a class |
K i kinda have a good idea of polymorphism and understand downcasting, but don't understand y u would upcast to the base class |
Author: | wtd [ Tue Jun 26, 2007 2:09 pm ] |
Post subject: | RE:Help in deriving a class |
An elephant is a mammal, but a mammal is not necessarily an elephant. There are things an elephant can do that all mammals cannot, and if you only know you have a mammal, then you can't flex its trunk. |