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;
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