what is difference between
String str="abc"; and String str=new String("abc");
1)String str=new string("abc") creates two objects, one in heap memory and one in string pool.It utilize memory in a better way with fulfilling object creation. While String st="abc" creates one object which goes to string pool.It consumes less memory.
2)String str = abc is a String literal where as String str = new String("abc") is a String Object.
Thank u very much!!!!!