String a = "abc";
String b = "xyz";
String result = a + b;
I was wondering if “result” string is a String constant allocated memory in string pool or a new object created on heap.
I know that new String() creates object on heap and String constants like a,b in the above example in permgen string pool space.
An important note:
is the same as
but
is the same as