I know that line one is the same as line two in the code below
String s1 = new String("a") + new String("b");
String s2 = new Stringbuilder().append("a").append("b").toString();
But I'm unsure whether either version will put the resulting string "ab"
into the string constant pool.
Does new String("ab")
create a new object or does it just return "ab"
from the constant pool?
String s3 = new String("ab");