Now compile will create 2 Objects : >> a String Object "kathy" and put it into "String constant Pool"
>> A StringBuilder Object on the heap which will reference to "kathy" Object on SCP.
>> so Overall s (this one on stack) ---> StringBuilder (on Heap) ---->"kathy" ( on SCP)
Now what is SCP (String Constant Pool) : Generally when a java program runs, We create a lots of string object that waste a lot of memory, So in order to make JAVA Memory Efficient, JVM set aside some area of Heap called String Constant pool, in which all object of String literals aside.
Please reply again if you need some more light on SCP.