wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 8805
    
    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.)
 
 
subject: How many Objects are garbage collected?
 
Similar Threads
Accessing Weakly Referenced Objects
Object References & GC
Clarification on Garbage Collection
What is the diff. b/w "==" and ".equals( )" Operators