Jump to content

Covariance and contravariance (computer science)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 134.28.70.118 (talk) at 08:10, 26 October 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

(Computer Science, object orientation) - arguments of overriding methods can take arguments supertypes of the original arguments. Related concepts are Covariance (arguments have to be of subtype) and invariance (arguments have to be of exactly same type). Also see http://c2.com/cgi/wiki?ContraVsCoVariance (external link).