1
Reply

What is Co- and Contra-Variance in C#?

Amit Kumar

Amit Kumar

Oct 24, 2012
943
0

    CovarianceEnables you to use a more derived type than originally specified. You can assign an instance of IEnumerable (IEnumerable(Of Derived) in Visual Basic) to a variable of type IEnumerable.ContravarianceEnables you to use a more generic (less derived) type than originally specified. You can assign an instance of IEnumerable (IEnumerable(Of Base) in Visual Basic) to a variable of type IEnumerable.

    kapil gupta
    August 10, 2016
    0