Saturday 22 February 2014

covariance and contra variance in C#.

Covariance:-
Suppose  S is subclasses of class A, type X is covariant if X<S> allows a reference conversion to
X<A>.
In other words, type MyClass<T> is covariant if the following is legal:
MyClass<int> a = someValue;
MyClass<object> o = a;


No comments:

Post a Comment