Tags: java

Java generics and inheritance (part 2)

On the first part of this article I explained why java generics don't allow up-casting for generified types. In this part we will see why, arrays don't have that restriction, and the implications

Tags: java

Java generics and inheritance (part 1)

Types, Sets, variables and casting When you use a compile-time typed language, like Java, you expect that types in each variable will help you by restricting the possibilities for a value. Instead of