As we know that when we create new String object by new keyword like this:
String str = new String("New String Will Have Two Objects");
It will create two objects of, one on java heap memory and other on String pool.
So when we call access "str"
which string object is accessed(heap object or string pool object)?
According to my understanding the string pool object is get accessed, if yes then what happens to heap object?