Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Where is a new object allocated memory?

a) Young space
b) Old space
c) Young or Old space depending on space availability
d) JVM

Answer: a
Explanation: A new object is always created in young space. Once young space is full, a special young collection is run where objects which have lived long enough are moved to old space and memory is freed up in young space for new objects.

Join The Discussion