what is meant by obsolete reference in java?

Viewed 5270

I am reading Effective Java and I came across this term, "Obsolete Reference". When is a reference obsolete reference? I am assuming that all the objects that don't fall out of scope and remain unused are obsolete references. Correct me if I am wrong.

5 Answers

A simple explanation is that even if the value popped from the method, that value is still being pointed inside the array by its index. So even if the program really is done with the passed-by reference copy, it will still be in the heap because of the elements array used in the stack.

Related