Sumukh Deshpande wrote:
Baichuan Huang wrote:hi:
so
hope this helps!
But does that mean in below case there will not be any object on pool?
String str_2 = new String("abc");
Out of every
new object is inside the heap.
when the jvm is Compileing,it will goto String pool to find the "abc"
if there is no "abc", it will create "abc" in String pool
and when the jvm is running,it will find the "abc" in String pool and create a String Object-->new String("abc") the "abc" is Copy from which Object valued "abc" in String pool
now, the new String("abc") is create at heap.
i am so sorry,at first,i forget it.
now ,hope this helps!