hi all, my native language is not english, and i have a problem when reading the java doc of String.intern() method. the following text is extract from the documentation:
-----------------------------------------------------------------------------------
When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.
-----------------------------------------------------------------------------------
i just don't know the "a reference to this String object is returned" part, does the "the reference to this String" means the string that the java keyword "this" represents or the string newly add to the string pool?
eg,
String s=new String("abc"); //create a string
s.intern(); //add s to the string pool, and return what? s itself or the string just added to string pool?
greate thanks!