P
puzzlecracker
There is something about being more specific and general?
what are those?
what are those?
puzzlecracker said:There is something about being more specific and general?
what are those?
Oliver said:The overriding method has to be able to handle every situation the
overridden method can handle, the the overriding method has to be usable in
every situation the overridden method could have been used.
Therefore, the parameters have to be of the same type, or of a more
general type (so that it can handle everything the old method could handle
and more), and the return value has to be of the same type, or a more
specific type (so that anything that could handle the old return value can
also handle the new one).
- Oliver
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.