Pregunta de entrevista de Salesforce

How does the garbage collector know if an object can be collected?

Respuestas de entrevistas

Anónimo

24 abr 2014

1.when the object is no longer referenced by anyother object. 2. when the obj is defined null

1

Anónimo

5 ene 2016

Reference counting is a form of garbage collection whereby each object has a count of the number of references to it. Garbage is identified by having a reference count of zero. An object's reference count is incremented when a reference to it is created, and decremented when a reference is destroyed. When the count reaches zero, the object's memory is reclaimed. (Wikipedia)