One thought on “Covariance in Arrays

  1. Yeah, as Eric mentions this is a problem in Java too. But I can understand why the original Java developers might have done it this way. If arrays were invariant on their type parameter, the compiler would not let you pass in a Derived[] instance to a method which expects a Base[].

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>