Heap pollution
Appearance
An editor has nominated this article for deletion. You are welcome to participate in the deletion discussion, which will decide whether or not to retain it. |
In Java programming language, type arguments and variables are not reified at run-time. As a result, different parameterized types are implemented by the same class or interface at run time. Indeed, all invocations of a given generic type declaration share a single run-time implementation. This results in the possibility of heap pollution.[1]
Under certain conditions, it is possible that a variable of a parameterized type refers to an object that is not of that parameterized type. The variable will always refer to an object that is an instance of a class that implements the parameterized type.
Reference
- ^ Langer, Angelika. "Java Generics FAQs: Heap pollution". http://www.angelikalanger.com/. Retrieved 15 July 2014.
{{cite web}}
: External link in
(help)|website=