Question: what is difference between string literals and string object?
Answer: 13 Answers. When you use a string literal the string can be interned, but when you use new String("...") you get a new string object. In general, you should use the string literal notation when possible. It is easier to read and it gives the compiler a chance to optimize your code.