Question: what is the difference between creating string object using new and string literals?
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.