What is the meaning of the concepts \'covariance\' and \'contravariance\'?
Given 2 classes, Animal and Elephant (which inherits from
public interface IGoOut
{
T Func();
}
public interface IComeIn
{
void Action(T obj);
}
public class GoOutClass:IGoOut
{
public T Func()
{
return default(T);
}
}
public class ComeInClass : IComeIn
{
public void Action(T obj) { }
}
==========================================================
object obj = null;
//Covariance Example [Array + IEnumerable + IEnumerator + IInterface + Func]
object[] array = (string[]) obj;
IEnumerable