What is variance in Scala?

In the generic types, the variance is the correlation between the inheritance relation of the abstract types and how it is “transmitted” to the inheritance in the generic classes. Scala supports variance annotations of type parameters of generic classes, to allow them to be covariant, contravariant, or invariant. More …