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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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").