▁Animal ▁ ▁Since ▁both ▁declaration - site ▁and ▁use - site ▁annotations ▁can ▁be ▁useful , ▁some ▁type ▁systems ▁provide ▁both . ▁ ▁Origin ▁of ▁the ▁term ▁cov ar iance ▁ ▁These ▁terms ▁come ▁from ▁the ▁notion ▁of ▁cov ari ant ▁and ▁cont rav ari ant ▁fun ctors ▁in ▁category ▁theory . ▁Consider ▁the ▁category ▁ ▁whose ▁objects ▁are ▁types ▁and ▁whose ▁morph isms ▁represent ▁the ▁sub type ▁relationship ▁▁ ≤ . ▁( This ▁is ▁an ▁example ▁of ▁how ▁any ▁partially ▁ordered ▁set ▁can ▁be ▁considered ▁as ▁a ▁category .) ▁Then ▁for ▁example ▁the ▁function ▁type ▁constructor ▁takes ▁two ▁types ▁p ▁and ▁r ▁and ▁creates ▁a ▁new ▁type ▁p ▁→ ▁r ; ▁so ▁it ▁takes ▁objects ▁in ▁ ▁to ▁objects ▁in ▁. ▁By ▁the ▁sub ty ping ▁rule ▁for ▁function ▁types ▁this ▁operation ▁revers es ▁ ≤ ▁for ▁the ▁first ▁parameter ▁and ▁pres erves ▁it ▁for ▁the ▁second , ▁so ▁it ▁is ▁a ▁cont rav ari ant ▁fun ctor ▁in ▁the ▁first ▁parameter ▁and ▁a ▁cov ari ant ▁fun ctor ▁in ▁the ▁second . ▁ ▁See ▁also ▁▁ ▁Pol ym orphism ▁( comput er ▁science ) ▁ ▁In herit ance ▁( comput er ▁science ) ▁ ▁References ▁ ▁External ▁links ▁▁ ▁Fab ul ous ▁Advent ures ▁in ▁C oding : ▁An ▁article ▁series ▁about ▁implementation ▁concerns ▁surrounding ▁co / contra var iance ▁in ▁C # ▁ ▁Cont ra ▁V s ▁Co ▁Var iance ▁( note ▁this ▁article ▁is ▁not ▁updated ▁about ▁C ++) ▁ ▁Cl os ures ▁for ▁the ▁Java ▁ 7 ▁Program