Arrays are covariant but generics aren'. The following is the explanation behind using wildcard `<? extends T>` in generics.
At heart, these terms describe how the subtype relation is affected by type transformations. That is, if A and B are types, f is a type transformation, and ≤ the subtype relation (i.e. A ≤ B means that A is a subtype of B), we have
f is covariant if A ≤ B implies that f(A) ≤ f(B)
f is contravariant if A ≤ B implies that f(B) ≤ f(A)
f is invariant if neither of the above holds
Ref
- https://dzone.com/articles/covariance-and-contravariance
- https://stackoverflow.com/a/2501513/1749223
- https://stackoverflow.com/a/8482091/1749223