Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Within the type system of a programming language, covariance and contravariance refers to the ordering of types from narrower to wider and their interchangeability or equivalence in certain situations (such as parameters, generics, and return types).
- covariant: converting from wider (double) to narrower (float).
- contravariant: converting from narrower (float) to wider (double).
- invariant: Not able to convert.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement