Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Dangers of Correlating Subtype Polymorphism with Generic Polymorphism

 
Lukas Eder
Ranch Hand
Posts: 48
5
Java Oracle Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Dangers of Correlating Subtype Polymorphism with Generic Polymorphism

Java 5 has introduced generic polymorphism to the Java ecosystem. This has been a great addition to the Java language, even if we’re all aware of the numerous caveats due to generic type erasure and the consequences thereof. Generic polymorphism (also known as parametric polymorphism) is usually maintained orthogonally to possibly pre-existing subtype polymorphism.

In this rather technical article, I have explained why it is difficult to correlate subtype polymorphism with generic polymorphism within the same type hierarchy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic