Является ли String Literal Pool коллекцией ссылок на строковый объект или коллекцией объектов?

Я все в замешательстве после прочтения статьи на сайте javaranch Кори Макглоне, автора The TipJP Tip Line. по имени Строки, Буквально и SCJP Руководство по программированию на Java 6 от Кэти Сьерра (соучредитель javaranch) и Берт Бейтс.

Я попытаюсь процитировать то, что мистер Кори и г-жа Кэти Сьерра процитировали о строковом буквальном пуле.

1. По словам г-на Кори Макглоуна:

String Literal Pool is a Collection of references that point to the String Objects.

String s = "Hello"; (Assume there is No object on the Heap named "Hello"), will create a String object "Hello" on the heap, and will place a reference to this object in the String Literal Pool (Constant Table)

String a = new String("Bye"); (Assume there is No object on the Heap named "Bye", new operator will oblige the JVM to create an object on the Heap.

Теперь объяснение"new" Оператор для создания String и его ссылки немного запутан в этой статье, поэтому я помещаю код и     Объяснение из самой статьи как есть - ниже.

public class ImmutableStrings
{
    public static void main(String[] args)
    {
        String one = "someString";
        String two = new String("someString");

        System.out.println(one.equals(two));
        System.out.println(one == two);
    }
}

В этом случае мы фактически получаем немного другое поведение из-за ключевого слова"new." In such a case, references to the two String literals are still put into the constant table (the String Literal Pool), but, when you come to the keyword "new," JVM обязана создавать новый объект String во время выполнения, вместо того, чтобы использовать тот из таблицы констант.

Вот диаграмма, объясняющая это ..

enter image description here

So does it mean, that String Literal Pool too has a reference to this Object ?

Вот ссылка на статью Кори Макглоун

http://www.javaranch.com/journal/200409/Journal200409.jsp#a1

2. Согласно Кэти Сьерра и Берт Бейтс в книге SCJP:

To make Java more memory efficient, the JVM set aside a special area of memory called the "String constant pool", when the compiler encounters a String Literal, it checks the pool to see if an identical String already exists or not. If not then it creates a new String Literal Object.

String s = "abc"; // Creates one String object and one reference variable....

that's fine, but then I was confused by this statement:

String s = new String("abc") // Creates two objects, and one reference variable.

It says in the book that.... a new String object in normal(non-pool) memory , and "s" will refer to it... whereas an additional literal "abc" will be placed in the pool.

The above lines in the book collide with the one in the article by Corey McGlone.

If String Literal Pool is a collection of references to the String object as mentioned by Corey McGlone, then why wil the literal object "abc" be placed in the pool (as mentioned in the book)?

And where does this String Literal Pool reside?

Пожалуйста, удалите это сомнение, хотя оно не будет иметь большого значения при написании кода, но очень важно с точки зрения управления памятью, и вот почему я хочу очистить этот фундамент.

Ответы на вопрос(1)

Ваш ответ на вопрос