Forums Register Login

How many Objects are garbage collected?

+Pie Number of slices to send: Send

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?
+Pie Number of slices to send: Send
Thomas -
unless you've buried something tricky in there somewhere, you are right - two objects are g.c. eligible.
Attractive, successful people love this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 847 times.
Similar Threads
What is the diff. b/w "==" and ".equals( )" Operators
Accessing Weakly Referenced Objects
Clarification on Garbage Collection
Object References & GC
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:56:01.