String s = "Test"; // creates one String object and one reference variable
In this simple case, "Test" will go in the pool and s will refer to it.
String s = new String("Test"); // creates two objects and one reference variable
In this case, because we used the new keyword, Java will create a new String object
in normal (non-pool) memory, and s will refer to it. In addition, the literal "Test" will
be placed in the pool.
but what they have in common is that they all create a new String object, with a
value of "Test", and assign it to a reference variable s.