What is covariance and contravariance in C#?
195
23-Jun-2025
Ponu Maurya
23-Jun-2025Answer:
Covariance and contravariance allow you to use a more derived or more base type than originally specified.
out): Enables method to return a more derived type.in): Allows passing a less derived type as an argument.Applies to generic interfaces and delegates.