Pergunta de entrevista da empresa Salesforce

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

Respostas da entrevista

Sigiloso

24 de abr. de 2014

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

1

Sigiloso

5 de jan. de 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)