Java Generics FAQ

TwitterFacebook
Get flash to fully experience Pearltrees
Generic types (or generics) bear a superficial resemblance to templates in C++, both in their syntax and in their expected use cases (such as container classes). But the similarity is only skin-deep -- generics in the Java language are implemented almost entirely in the compiler, which performs type checking and type inference, and then generates ordinary, non-generic bytecodes. This implementation technique, called erasure (where the compiler uses the generic type information to ensure type safety, but then erases it before generating the bytecode), has some surprising, and sometimes confusing, consequences. http://www.ibm.com/developerworks/java/library/j-jtp01255/index.html

Java theory and practice: Generics gotchas

All text and content found at URLs starting with http://www.AngelikaLanger.com/GenericsFAQ/ (collectively, "the Java Generics FAQ") are the sole property of Angelika Langer.

Java Generics FAQs - Frequently Asked Questions

http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html