▁keywords ▁ ▁and ▁), ▁and ▁Scala ▁and ▁O C aml ▁( using ▁the ▁keywords ▁ ▁and ▁). ▁C # ▁only ▁allows ▁variance ▁annotations ▁for ▁interface ▁types , ▁while ▁K otlin , ▁Scala ▁and ▁O C aml ▁allow ▁them ▁for ▁both ▁interface ▁types ▁and ▁concrete ▁data ▁types . ▁ ▁Inter faces ▁ ▁In ▁C #, ▁each ▁type ▁parameter ▁of ▁a ▁generic ▁interface ▁can ▁be ▁marked ▁cov ari ant ▁( ), ▁cont rav ari ant ▁( ), ▁or ▁invariant ▁( no ▁annotation ). ▁For ▁example , ▁we ▁can ▁define ▁an ▁interface ▁ ▁of ▁read - only ▁iter ators , ▁and ▁declare ▁it ▁to ▁be ▁cov ari ant ▁( out ) ▁in ▁its ▁type ▁parameter . ▁ ▁interface ▁IE numer ator < out ▁T > ▁{ ▁▁▁▁ ▁T ▁Current ▁{ ▁get ; ▁} ▁▁▁▁ ▁bool ▁Move Next (); ▁} ▁ ▁With ▁this ▁declaration , ▁ ▁will ▁be ▁treated ▁as ▁cov ari ant ▁in ▁its ▁type ▁parameter , ▁e . g . ▁ ▁is ▁a ▁sub type ▁of ▁. ▁ ▁The ▁type check er ▁enfor ces ▁that ▁each ▁method ▁declaration ▁in ▁an ▁interface ▁only ▁mentions ▁the ▁type ▁parameters ▁in ▁a ▁way ▁consistent ▁with ▁the ▁/ ▁annotations . ▁That ▁is , ▁a ▁parameter ▁that ▁was ▁declared ▁cov ari ant ▁must ▁not ▁occur ▁in ▁any ▁cont rav ari ant ▁positions ▁( where ▁a ▁position ▁is ▁cont rav ari ant ▁if ▁it ▁occurs ▁under ▁an ▁odd ▁number ▁of ▁cont rav ari ant ▁type ▁construct ors ). ▁The ▁precise ▁rule ▁is ▁that ▁the ▁return ▁types ▁of ▁all ▁methods ▁in ▁the ▁interface