1 9 9 8 . ▁Scala ▁and ▁D ▁ ▁also ▁support ▁cov ari ant ▁return ▁types . ▁ ▁Cont rav ari ant ▁method ▁parameter ▁type ▁ ▁Similarly , ▁it ▁is ▁type ▁safe ▁to ▁allow ▁an ▁overrid ing ▁method ▁to ▁accept ▁a ▁more ▁general ▁argument ▁than ▁the ▁method ▁in ▁the ▁base ▁class : ▁ ▁class ▁Cat Sh elter ▁extends ▁Animal Sh elter ▁{ ▁▁▁▁ ▁void ▁put An imal ( Object ▁animal ) ▁{ ▁▁▁▁▁▁▁▁ ▁// ▁... ▁▁▁▁ ▁} ▁} ▁ ▁Not ▁many ▁object - orient ed ▁languages ▁actually ▁allow ▁this . ▁C ++ ▁and ▁Java ▁would ▁interpret ▁this ▁as ▁an ▁un related ▁method ▁with ▁an ▁over loaded ▁name . ▁ ▁However , ▁S ather ▁supported ▁both ▁cov ar iance ▁and ▁contra var iance . ▁Call ing ▁convention ▁for ▁overrid den ▁methods ▁are ▁cov ari ant ▁with ▁out ▁parameters ▁and ▁return ▁values , ▁and ▁cont rav ari ant ▁with ▁normal ▁parameters ▁( with ▁the ▁mode ▁in ). ▁ ▁Cov ari ant ▁method ▁parameter ▁type ▁ ▁A ▁couple ▁of ▁main stream ▁languages , ▁E iff el ▁and ▁D art ▁allow ▁the ▁parameters ▁of ▁an ▁overrid ing ▁method ▁to ▁have ▁a ▁more ▁specific ▁type ▁than ▁the ▁method ▁in ▁the ▁super class ▁( parameter ▁type ▁cov ar iance ). ▁Thus , ▁the ▁following ▁D art ▁code ▁would ▁type ▁check , ▁with ▁ ▁overrid ing ▁the ▁method ▁in ▁the ▁base ▁class : ▁ ▁class ▁Cat Sh elter ▁extends ▁Animal Sh elter ▁{ ▁▁▁▁▁ ▁void ▁put An imal ( cov ari ant ▁Cat ▁animal ) ▁{ ▁▁▁▁▁▁▁▁ ▁// ▁... ▁▁▁▁