
-----------------------------------
Junaid2pac
Mon Jun 25, 2007 6:22 pm

Help in deriving a class
-----------------------------------
Can someone explain how to derive a class and explain the use for it???

Thank

-----------------------------------
wtd
Tue Jun 26, 2007 11:19 am

RE:Help in deriving a class
-----------------------------------
The question you should be asking is "what is polymorphism, and why should I care?"

-----------------------------------
Junaid2pac
Tue Jun 26, 2007 12:40 pm

Re: Help in deriving a class
-----------------------------------
That was actually my next question

So ya...Any guidance will be helpful

-----------------------------------
Junaid2pac
Tue Jun 26, 2007 1:01 pm

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

-----------------------------------
wtd
Tue Jun 26, 2007 2:09 pm

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.
