If I run,
String s1="abc";
then are there any differences between:
String s2=new String(s1);
and
String s2="abc";
Here's what I'm confused about:
The Head First Java says:"If there's already a String in the String pool with the same value, the JVM doesn't create a duplicate, it simply refers your reference variable to the existing entry. " Which at my point of view is that the s1 has already created "abc",s2 just refers to it. Am I right??