When string is created using new then where is the object stored in heap memory or string constant pool or both?
In Java, where is the string literal that is passed in the string constructor created while we are creating a string object using a new string (string constant)?