java docs says:
A pool of strings, initially empty, is maintained privately by the
class String.
1) Is it a pool of string literals or references to these string literals? on net some articles refer it as pool of strings literals while other refer it as pool of references so i got confused.
2) Is string pool created per class basis or per JVM basis?
3)Is there any reference where i can find details of string pool, its implementation etc.?
It is the same thing. You can’t have a String object without a reference, or vice-versa.
And, as Peter Lawrey puts it: “In Java, an Object is inside the heap. Nowhere else. The only thing you can have inside something else, an object, an array, a collection or the stack, is a reference to that object.”
There is one String pool per JVM … unless you are using some exotic JVM where they’ve decided to implement it differently. (The spec doesn’t say that there has to be one string pool for the JVM, but that’s generally the most effective way to do it.)
You can download the complete source code of OpenJDK 6 or 7. The spring pool is implemented in native code … so you’ll be reading C++.