Scala Variances: Covariance, Contravariance, and Invariance

1. Variance

Variance is the interconnection of subtyping relationship between complex types and their component types.

Variance is all about sub-typing. It tells us if a type constructor is a subtype of another type constructor. Variance defines inheritance relationships of parameterized types(types that have parameters within them).