evandrix

Covariance

Oct 22nd, 2011
207
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. 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).
  2.  
  3. covariant: converting from wider (double) to narrower (float).
  4. contravariant: converting from narrower (float) to wider (double).
  5. invariant: Not able to convert.
  6.  
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment