• Post Reply Bookmark Topic Watch Topic
  • New Topic

String Garbage Collection  RSS feed

 
Varadhan Sesharaman
Ranch Hand
Posts: 30
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI

I have a method



In this all the two strings are eligible for garbage collection?

Thanks,
varadhan
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you think is the answer and why?
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
… and always tell us where such questions come from.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Varadhan Sesharaman wrote:
I have a method



In this all the two strings are eligible for garbage collection?


I am assuming that you want to know how many object are eligible, after one call to the method listed?

To figure that out, can you tell us how many string objects are instantiated by the method?

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!