Covariance
Noun · Development
Definitions
A type relationship where a generic type preserves the subtyping direction of its parameter — if Cat extends Animal, then List<Cat> is assignable to List<Animal>. Safe for producers (read-only) but not consumers (writable). Declared with 'out' in Kotlin, '+ ' in Scala, and 'extends' in Java wildcards.
In plain English: When a container of a specific type can be used where a container of a more general type is expected.
Example: "The function returns List<out Animal> — covariant, so you can return a List<Cat> but can't add items to it."