1.

Where is a new object allocated memory?(a) Young space(b) Old space(c) Young or Old space depending on space availability(d) JVMThe question was posed to me in quiz.Question is from Heap and Garbage Collection in chapter Classes and Methods of Java

Answer»

Correct option is (a) Young space

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



Discussion

No Comment Found

Related InterviewSolutions