More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. It's possible because internally java first reserves the memory for the new concatenated string and then copy that over. So after concatenation, there are 2 strings in memory, the original one and the concatenated one and then the reference is moved to the concatenated string.
Help us improve. Please let us know the company, where you were asked this question :