Author |
Message |
Junaid2pac
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
wtd
|
Posted: 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?" |
|
|
|
|
![](images/spacer.gif) |
Junaid2pac
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Junaid2pac
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
|