if i create a string object as
String s=new String(\"Stackoverflow\");
will String object created only in heap, or it also makes a copy in Str
A regular java object will be created in the heap, and will have a reference s type of String. And, there will be String literal in String Constant Pool. Both are two different things.
s
String