Hallo,
Yes you have the difference between two.
String s ="Maruthi";
It creates a String containing "Maruthi", and a reference, s pointing to it.
String s1 = new String("Maruthi");
This creates a new String-object that points to a
String ("Maruthi"), and a reference s will be
pointing to the new String-object
So it will function the same, but the second option
s1 will get two references. ( don't worry).
Example:
There is another important issue..
String s1 = "Maruthi";
String s2 = "Maruthi";
String s3 = new String("Maruthi");
Now s1 == s2 ,its True
but s1 != s3, Its False
That is s1 and s2 references the same object, but s3 references another object.
Regards
Maruthi.