"Covariant and Contravariant Generic Parameters in Delegates"

delegate T Covariant<out T>();
delegate void Contravariant<in T>(T value);

static void Test() {
	Covariant<object> covariantObj;
	Covariant<int> covariantInt = () => 3;
	
	covariantObj = covariantInt;
	


	Contravariant<object> contravariantObj = myObj => Console.WriteLine(myObj);
	Contravariant<int> contravariantInt;
	
	contravariantInt = contravariantObj;
}


Code snippet taken from "Two Decades of C#: A Reference - C# 2, 3 and 4".