Java Generics: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:
O'Reilly Java Generics and Collections.
O'Reilly Java Generics and Collections.


http://localhost:9627/personal/Wiki.jsp?page=Java5Generics


=Organizatorium=
=Organizatorium=

Revision as of 22:16, 15 June 2018

Internal

TODO

O'Reilly Java Generics and Collections.

http://localhost:9627/personal/Wiki.jsp?page=Java5Generics

Organizatorium

Covariance

https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)

Let T and S be two types (class or function types), such that S is a subtype of T. If method m of T is overridden in S, then the corresponding types from the m's signature can either preserve the relationship between T and S (the type used in S is a subtype of the corresponding type in T), reverse the relationship (the type used in S is a super type of the type used in T), or neither preserve nor reverse this relationship. If they preserve the relationship to T and S, we say they are covariant, if they reverse the relationship of T and S, we say they are contravariant.