Does the previous String s get garbage collected after mySetter is called or should I null out s before I assign it to the new value?
If your previous String s
is not referenced anywhere then it will be. But it won't happen immmedialtely after mySetter
is called. No need to set it to null
.