i have read that object becomes eligible for garbage collection in following cases.
- All references of that object explicitly set to null.
- Object is created inside a block and reference goes out scope once control exit that block.
- Parent object set to null, if an object holds reference of another object and when you set container object's reference null, child or contained object automatically becomes eligible for garbage collection.
But is there anyway to identify that object which is eligible for garbage collection is collected by garbage collector?