File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GarbageCollection

 
G Nadeem
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
ur help plz...

is the object created at line 2 elligible for GC after line 4 executes.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Remember, Strings are immutable objects. Therefore, performing a concatenation operation creates a brand new String. It does not reference the existing Strings that were used in the concatentation.
Therefore, the object is eligible for garbage collection after line 4.
I hope that helps,
Corey
 
G Nadeem
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx v much Corey...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic