why soft/weak/phantom reference is required instead of making object is null. I am not having clear idea why do we need to use these references.
As far as my understanding the inner object may be null but the outer object is reachable then inner object wont be garbage collected, to collect the inner object we need to use the soft/weak/phantom reference. Is this correct or do we have some other reason to use it?
I read in one of the stack over flow post the modern JVM are taking care of this inner object is null then garbage collected, i cannot able to find the more details for this.
Thanks in advance.