What is covariance and contravariance in C#?
Ask by Ponu Maurya
Updated 23 Jun 2025
Answer:
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.