in Java, are strong references accessible from weakly reachable objects are considered as strong references?
Example :
If there is no other pointer on X and Y, I would expect them to get garbage-collected. Am I wrong?
Even though the term strong reference is used, perhaps it is better to think in terms of reach-ability.
That is, if the object is strongly reachable from a root object it is not eligibility for reclamation -- otherwise, it is. A strong reference to an object only referenced through a weak reference is not strongly reachable. However, the strong reference is still a strong reference.
Happy coding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With