String str = new String("Hello");
Normally I have read, in many articles available on internet, that two objects are created when we write the statement above. One String object is created on the heap and one string object is created on the Literal Pool. And the heap object is also referring the object created on Literal Pool. (Please correct this statement of mine if it is wrong.)
Please note that the above explanation is as per my understanding after reading some articles on internet.
So my question is.. Are there any ways available to stop creating the string object in literal pool. How it can be done?
[Please let me know about the best link for understanding of this Literal Pool, How is it implemented]