String objects are immutable - there is no way to modify a String object. The way you phrased the question is incorrect.
All methods in class String that do something with the content of the string, do not modify the original string - instead, they return a new String object that contains the modified content of the original string.
To prove this, look at the API documentation of class java.lang.String or look at the source code (which you can find in the file src.zip in your JDK installation directory), you will find that there are no methods in the class that modify the content of a String object.
I actually wanted to to print the memory Locations of a String Object being created using hashcode ( i was not successfull , as i could able to print only the reference of the String location which is always the same )