Effectively those two things have the same result in the end, but the second one, where you create a new String object explicitly, is inefficient. It prevents the compiler from using Java's string pooling mechanism and creates a new String object which is totally unnecessary.
It is never necessary to write
new String("some literal") - so, don't write code like that.
Matthew Brown wrote:The bottom line is: use String s = "foo". There's almost never a good reason to use the second form (and when I say "almost never" I probably mean "never").
If the string you're passing to the constructor of class String is a literal, it is certainly never necessary.