This problem was discovered last week when I looked at constant pools. After JDK7, string constant pools were moved to the heap, which holds literals and string references. When we define String a=”b”, we store a reference to that String object on the heap. In the future, you can use the reference directly, at the same time String. The intern() method also saves a reference to the string.

So is this created confusion, for the judgment of whether a string is used by the StringTable to find whether there is the reference, so the heap string constant pool, what do you use his inside put literal and a reference is when in use, because both a on the heap, a local memory. Is the string constant pool just a name for all strings on the heap? Hope to know can help answer, be grateful.