The String objects are stored in heap. For example:
String s1 = new String("s1");
s1
object will be stored in heap;
The String literals are stored in string constant pool.
String s2 = "s2";
s2
object will be stored in string constant pool (possibly inside of heap).
I have heard about runtime constant pool.
But I do not understand what specifically will be stored there. Is it the same as string constant pool? Or what should I write so it stores in runtime constant pool?