heap pollution in Java

Here you can post the doubts and informations of related to both Java and Java Server Pages(JSP), JSP Programming concepts.

heap pollution in Java

Postby Suji on Fri Oct 30, 2009 3:29 pm

Hi,

What is Heap pollution? When does it occur?
Suji
Newbee
Newbee
 
Posts: 35
Joined: Thu Sep 27, 2007 3:52 pm


Re: heap pollution in Java

Postby nirmala on Sat Oct 31, 2009 12:03 pm

Hi...
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.

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.
nirmala
Enthusiast
Enthusiast
 
Posts: 299
Joined: Fri Feb 29, 2008 3:38 pm


Return to Java/JSP Forum

Who is online

Users browsing this forum: No registered users and 0 guests