Originally posted by rex tony:
String s= "REX";
String s= new String("REX");
Both are classes too.
what are the Main Key differences
String s= "REX";
a string refrence s is created and a string with the REX value is created in the string pool.
String s= new String("REX");
a string refrence s is created and a string with the REX value is created in the string pool, and a String object is created in the heap.