aspose file tools*
The moose likes Beginning Java and the fly likes How many Objects are garbage collected? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How many Objects are garbage collected?" Watch "How many Objects are garbage collected?" New topic
Author

How many Objects are garbage collected?

Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192

C:\Java\EigeneJavaProgramme>java GarbageCollector1
i2 == i1: true
i1 =null i2 =null
I think 2 objects (Integer(1) and Integer(2) are eligable for gc.
Is it correct?
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8883
    
    5
Thomas -
unless you've buried something tricky in there somewhere, you are right - two objects are g.c. eligible.


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How many Objects are garbage collected?