▁the ▁overrid ing ▁method ▁should ▁return ▁a ▁more ▁specific ▁type ▁( return ▁type ▁cov ar iance ), ▁and ▁accept ▁a ▁more ▁general ▁argument ▁( parameter ▁type ▁contra var iance ). ▁In ▁U ML ▁notation , ▁the ▁possibilities ▁are ▁as ▁follows : ▁ ▁For ▁a ▁concrete ▁example , ▁suppose ▁we ▁are ▁writing ▁a ▁class ▁to ▁model ▁an ▁animal ▁shelter . ▁We ▁assume ▁that ▁ ▁is ▁a ▁subclass ▁of ▁, ▁and ▁that ▁we ▁have ▁a ▁base ▁class ▁( using ▁Java ▁syntax ) ▁ ▁class ▁Animal Sh elter ▁{ ▁▁▁▁▁ ▁Animal ▁get An imal For A do ption () ▁{ ▁▁▁▁▁▁▁▁ ▁// ▁... ▁▁▁▁ ▁} ▁▁▁▁▁▁▁▁▁ ▁void ▁put An imal ( An imal ▁animal ) ▁{ ▁▁▁▁▁▁▁▁ ▁// ... ▁▁▁▁ ▁} ▁} ▁ ▁Now ▁the ▁question ▁is : ▁if ▁we ▁subclass ▁, ▁what ▁types ▁are ▁we ▁allowed ▁to ▁give ▁to ▁ ▁and ▁? ▁ ▁Cov ari ant ▁method ▁return ▁type ▁ ▁In ▁a ▁language ▁which ▁allows ▁cov ari ant ▁return ▁types , ▁a ▁derived ▁class ▁can ▁override ▁the ▁ ▁method ▁to ▁return ▁a ▁more ▁specific ▁type : ▁ ▁class ▁Cat Sh elter ▁extends ▁Animal Sh elter ▁{ ▁▁▁▁▁ ▁Cat ▁get An imal For A do ption () ▁{ ▁▁▁▁▁▁▁▁ ▁return ▁new ▁Cat (); ▁▁▁▁ ▁} ▁} ▁ ▁Among ▁main stream ▁O O ▁languages , ▁Java ▁and ▁C ++ ▁support ▁cov ari ant ▁return ▁types , ▁while ▁C # ▁does ▁not . ▁Adding ▁the ▁cov ari ant ▁return ▁type ▁was ▁one ▁of ▁the ▁first ▁modifications ▁of ▁the ▁C ++ ▁language ▁approved ▁by ▁the ▁standards ▁committee ▁in ▁