String s = new String("text");
It will create a new string object explicitly. Hence, its compilation is slower than the other.
String s = "text";
It creates a string literal from the string constant pool, if available. It will be stored in Heap Space. For code optimization and better performance, use this one.