Covariant and anti-change refers to the conversion of the type of the parameter and the return value.
If a generic type is labeled with an out keyword, the generic interface is covariant. This also means that the return type can only be t. The interface index and type T are covariant and return this type from a read-only indexer;
Public Interface iindex< out t>{ T thisiint index{get;} int Count {get;}}
If a generic type is labeled with the IN keyword, the generic interface is immutable, and the interface can only use the generic type T as the input to its method.
Public Interface idisplay< in t>{ID Show (T item);}
If a system indexer is used on the interface iindex, the generic type T is passed to the method and retrieved from the method, which cannot be implemented by covariance-the generic type must be defined as immutable. If the out and in labels are not applicable, the type can be defined as immutable.
Covariance and anti-change of interface