String s = "abc"; //Creates one string object and one ref. var. In this simple case, "abc" will go to the pool and s will refer to it.
String s = new String("abc"); //Creates two objects, and one ref var. In this case, because we used the new keyword, Java will create a new String object in normal(non-pool) memory, and s will refer to it. In addition, the literal "abc" will be placed.
Why two objects are created in the second case? Still don't understand why the two cases are working differently. Plus, the second case looks like more inefficient.
In second case if i say: String s1 = s; Would s1 refer to the intermediate object pointed to by s or directly to "abc".