This post originated from an RSS feed registered with Java Buzz
by News Manager.
Original Post: Type dependency in Java, Part 1
Feed Title: JavaWorld
Feed URL: http://www.javaworld.com/index.rss
Feed Description: JavaWorld.com: Fueling Innovation
Understanding type compatibility is fundamental to writing good Java programs, but the interplay of variances between Java language elements can seem highly academic to the uninitiated. This article is for software developers ready to tackle the challenge! Part 1 reveals the covariant and contravariant relationships between simpler elements such as array types and generic types, as well as the special Java language element, the wildcard. Part 2 explores type dependency and variance in common API examples and in lambda expressions.
Get the source code for this article, "Type dependency in Java, Part 1."
Created for JavaWorld by Dr. Andreas Solymosi.
Concepts and terminology
Before we get into the relationships of covariance and contravariance among various Java language elements, let's be sure that we have a shared conceptual framework.