• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many Objects are garbage collected?

 
Thomas Markl
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas -
unless you've buried something tricky in there somewhere, you are right - two objects are g.c. eligible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic