Possible Duplicate:
What is the purpose of the expression “new String(…)” in Java?
I've found some old code that has new String("somestring") in it. Has there ever been a time when this was a good idea?
Possible Duplicate:
What is the purpose of the expression “new String(…)” in Java?
I've found some old code that has new String("somestring") in it. Has there ever been a time when this was a good idea?
Yes, but only for some usually rare case, like when you really have to make sure, that two Strings with equal content are not the same.
For details and other reasons - please refer to the numerous brilliant answers to the numerous questions concerning new String("something")
.