Only d should be correct answer
c is not correct because garbage collector cannot predict when
the object will not have any references to it.
b is incorrect because issuing command System.gc()
only suggests to start Garbage collector do not guarantees
e will be correct only if it were written as
"e.The garbage collector may run in low-memory situations."
I hope it clarifies your doubts
any other takers for it ?
Originally posted by Deepak Sachdeva:
Question 65: Which statements about garbage collection are true?
Select all valid answers.
a.You can directly free the memory allocated by an object.
b.You can directly run the garbage collector whenever you want to.
c.The garbage collector informs your object when it is about to be garbage collected.
d.The garbage collector reclaims an object�s memory as soon as it becomes a candidate for garbage collection.
e.The garbage collector runs in low-memory situations.
I selected option c & e as correct answer.but in the answer includes b also.How can we run GC , whenever we want...
IMO, we can just request to run not force.
can anybody explain me , what could be the right answer....
thanks in advance,
DS