This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
how many objects are eligible for Garbage collection
Premak Rajan
Greenhorn
Joined: Feb 12, 2007
Posts: 18
posted
0
I have doubt in this program
1. public class BettyAck{ 2. public static void main(String argv[]){ 3. BettyAck b =new BettyAck(); 4. } 5. public BettyAck() { 6. Integer x = new Integer(10); 7. findOut(x); 8. Integer y = new Integer(99); 9. Integer z = y; 10. z = null; 11. findOut(y); 12. //here 13. } 14. public void findOut(Integer y){ 15. y = null; 16. 17. } 18.}
my answer for this program is 3 objects are eligible for garbage collection.Is it correct or not? Please anyone help me