String s2 = s1.replace('m','r'); The above is same as String s2=new String("arit"); Which will create a new String object "arit" in the non String pool area of memory and s2 will be referring to that object.
Paper jam tastes about as you would expect. Try some on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss