seems like very close to the correct answer, particularly because in all of the questions on Garbage Collection here it says that if ALL the references to the object (as well as references to references) are nulled, its eligible. So what is making this option not correct - that fact that even if if all the totoal references are nulled it still can be hanging in the memory and actually deleted after unknown period of time?Objects are deleted when they can no longer be accessed through any reference.
About Question com.enthuware.ets.scjp.v6.2.297 :
Moderator: admin
About Question com.enthuware.ets.scjp.v6.2.297 :
This last option:
Re: About Question com.enthuware.ets.scjp.v6.2.297 :
Here is a quote from another question, com.enthuware.ets.scjp.v6.2.698 :
At the most, you can remove all the references to this object and wait for GC thread to destroy it but you cannot directly destroy any object.
Re: About Question com.enthuware.ets.scjp.v6.2.297 :
and again, from the same question:Guest wrote:Here is a quote from another question, com.enthuware.ets.scjp.v6.2.698 :
At the most, you can remove all the references to this object and wait for GC thread to destroy it but you cannot directly destroy any object.
You can do so by making sure that the object is not referenced any where. For example, by setting all its references to null.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.297 :
By setting the all references to an object to null, that object is made eligible to be deleted. That doesn't mean it is actually deleted. It is possible that it is never deleted.ETS User wrote:This last option:
seems like very close to the correct answer, particularly because in all of the questions on Garbage Collection here it says that if ALL the references to the object (as well as references to references) are nulled, its eligible. So what is making this option not correct - that fact that even if if all the totoal references are nulled it still can be hanging in the memory and actually deleted after unknown period of time?Objects are deleted when they can no longer be accessed through any reference.
HTH,
Paul.
Who is online
Users browsing this forum: No registered users and 10 guests