posted 9 years ago
can oca izo-803 exam ask question on how many objects are eligible for garbage collection??,..i have found 3 to 4 questions based on same but unable to decide...i know following points..
1>object is created when you assign a reference using new keyword
2>you can only decide when object is eligible for garbage collection
3> Ob b = new Ob(); b =null;
it is eligible for garbage collection.
i have referred questions like at line 7 and 14 how many object is eligible for garbage collection??..i am not getting expected output based on above points...
their are some question which creates object in class, and in main class create another object , i am unable to decide whether object collection starts form main and at end how many are eligible for garbage collection..
also i have learned that garbage collection also depends on scope of object...please can anyone help me to understand how to prepare yourself with such question and overcome tricky trap laid by oracle certification moderators..