This question already has an answer here:
What is the difference between
String str = new String("abc");
and
String str = "abc";
This question already has an answer here:
What is the difference between
String str = new String("abc");
and
String str = "abc";
The following are some comparisons:
When
intern()
is called the reference is changed.