Your American History Reference Guide!
- Parameter covariance

HistoryMania Information Site on Parameter covariance American History American History Search        American History Browse welcome to our free resource site for all enthusiasts!

Parameter covariance

If a class is inherited and a feature/method/attribute redefined, a parameter or return type can be changed to be a more specialised type.

So if we have a feature A that takes a formal argument T. We redefine A, the new A must have a formal argument of T, or any descendent of T.

Covariant parameters are not safe, but return types are. In Eiffel you can get compile errors , because the polymorphism breaks.

The contents of this article are licensed from Wikipedia.org under the
GNU Free Documentation License. How to see transparent copy
Search | Browse | Contact | Legal info