"Strings are constant; their values cannot be changed after they are created.
String buffers support mutable strings. Because
String objects are immutable they can be shared. For example:
String str = "abc";
is equivalent to:
char data[] = {'a', 'b', 'c'};
String str = new String(data);
"
This is the description given in
Java Doc by Sun.
I wish to know what this sharing refers to.
Thanks in advance.